UNPKG

@toptal/davinci-code

Version:

Code generation package for frontend applications

25 lines (18 loc) 598 B
// 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 { createNewCommand } = await import('./component.mjs') describe('createNewCommand', () => { let program beforeEach(() => { program = new Command() }) afterEach(() => { jest.clearAllMocks() }) it('creates a command with the correct parameters', () => { const command = createNewCommand(program) expect(JSON.stringify(command, null, 2)).toMatchSnapshot() }) })