-
Notifications
You must be signed in to change notification settings - Fork 12
Closed
Description
I am trying to test a command that leverages @inquirer/prompts, and cannot figure out how to stub the input prompt.
Here is my test
import * as prompts from '@inquirer/prompts'
import {expect, test} from '@oclif/test'
import New from '../../../src/commands/config/new'
describe('config:new', () => {
test
.stdout({print: true})
.stub(prompts, 'input', (stub) => stub.onFirstCall().resolves('First Last'))
.do(() => New.run([]))
.it('runs config:new', (ctx) => {
expect(ctx.stdout).to.contain('Hello First!')
})
})I receive the following error on the .stub call.
TypeError: ES Modules cannot be stubbedDoes anyone have a workaround?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels