Skip to content

Commit

Permalink
fix: use oclif/test v4
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed May 22, 2024
1 parent a9c668a commit 18bbab2
Show file tree
Hide file tree
Showing 4 changed files with 687 additions and 724 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
],
"dependencies": {
"@oclif/core": "^3",
"@oclif/plugin-help": "^5",
"@oclif/plugin-plugins": "^3.9.4"
"@oclif/plugin-help": "^6",
"@oclif/plugin-plugins": "^5"
},
"devDependencies": {
"@oclif/prettier-config": "^0.2.1",
"@oclif/test": "^3",
"@oclif/test": "^4",
"@types/chai": "^4",
"@types/mocha": "^10",
"@types/node": "^18",
Expand Down
13 changes: 6 additions & 7 deletions test/commands/esm2.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import {expect, test} from '@oclif/test'
import {runCommand} from '@oclif/test'
import {expect} from 'chai'

describe('hello', () => {
test
.stdout()
.command(['esm2'])
.it('runs esm2 cmd', ctx => {
expect(ctx.stdout).to.contain('hello I am an ESM plugin')
describe('esm2', () => {
it('runs esm2 cmd', async () => {
const {stdout} = await runCommand(['esm2'])
expect(stdout).to.contain('hello I am an ESM plugin')
})
})
12 changes: 6 additions & 6 deletions test/hooks/init/init.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {expect, test} from '@oclif/test'
import {runHook} from '@oclif/test'
import {expect} from 'chai'

describe('hooks', () => {
test
.stdout()
.hook('init', {id: 'mycommand'})
.do(output => expect(output.stdout).to.contain('Greetings!'))
.it('shows a message')
it('shows a message', async () => {
const {stdout} = await runHook('init', {id: 'mycommand'})
expect(stdout).to.contain('Greetings!')
})
})
Loading

0 comments on commit 18bbab2

Please sign in to comment.