@toptal/davinci-code
Version:
Code generation package for frontend applications
25 lines (18 loc) • 604 B
JavaScript
// eslint-disable-next-line import/no-extraneous-dependencies
import { jest } from '@jest/globals'
// eslint-disable-next-line import/no-extraneous-dependencies
import { Command } from 'commander'
const { createModuleCommand } = await import('./module.mjs')
describe('createModuleCommand', () => {
let program
beforeEach(() => {
program = new Command()
})
afterEach(() => {
jest.clearAllMocks()
})
it('creates a command with the correct parameters', () => {
const command = createModuleCommand(program)
expect(JSON.stringify(command, null, 2)).toMatchSnapshot()
})
})