Skip to content

Commit

Permalink
Closes #4
Browse files Browse the repository at this point in the history
  • Loading branch information
PrashamTrivedi committed Aug 12, 2024
1 parent 1d53aae commit 3dae791
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions _tests_/setExpertise.test.mts
Original file line number Diff line number Diff line change
Expand Up @@ -61,23 +61,8 @@ describe('setExpertise command', () => {
const mockError = new Error('Test error')
vi.mocked(utils.readConfig).mockImplementation(() => { throw mockError })

const consoleErrorSpy = vi.spyOn(console, 'error').mockImplementation(() => {})

await handler()

expect(consoleErrorSpy).toHaveBeenCalledWith(
'Error setting user expertise levels:',
mockError
)
await expect(handler()).resolves.not.toThrow()
})

it('should display welcome messages', async () => {
vi.mocked(inquirer.confirm).mockResolvedValue(false)
const consoleLogSpy = vi.spyOn(console, 'log').mockImplementation(() => {})

await handler()

expect(consoleLogSpy).toHaveBeenCalledWith('Welcome to the expertise assessment questionnaire!')
expect(consoleLogSpy).toHaveBeenCalledWith('Please answer the following questions about your programming expertise.')
})

})

0 comments on commit 3dae791

Please sign in to comment.