forked from oclif/oclif
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use oclif/test v4 (oclif#1420)
* test: use oclif/test v4 * chore: clean up * test: use new major of oclif/test * chore: bump commitlint * feat: generate CLI with oclif/test v4 * test: dont use createSandbox
- Loading branch information
1 parent
aa6f704
commit 1f8dbd9
Showing
19 changed files
with
446 additions
and
740 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(['hello', 'friend', '--from=oclif']) | ||
.it('runs hello cmd', ctx => { | ||
expect(ctx.stdout).to.contain('hello friend from oclif!') | ||
it('runs hello', async () => { | ||
const {stdout} = await runCommand('hello friend --from oclif') | ||
expect(stdout).to.contain('hello friend from oclif!') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 world', () => { | ||
test | ||
.stdout() | ||
.command(['hello:world']) | ||
.it('runs hello world cmd', ctx => { | ||
expect(ctx.stdout).to.contain('hello world!') | ||
it('runs hello world cmd', async () => { | ||
const {stdout} = await runCommand('hello world') | ||
expect(stdout).to.contain('hello world!') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,14 @@ | ||
import {expect, test} from '@oclif/test' | ||
import {runCommand} from '@oclif/test' | ||
import {expect} from 'chai' | ||
|
||
describe('<%- name %>', () => { | ||
test | ||
.stdout() | ||
.command(['<%- name %>']) | ||
.it('runs hello', ctx => { | ||
expect(ctx.stdout).to.contain('hello world') | ||
it('runs <%- name %> cmd', async () => { | ||
const {stdout} = await runCommand('<%- name %>') | ||
expect(stdout).to.contain('hello world') | ||
}) | ||
|
||
test | ||
.stdout() | ||
.command(['<%- name %>', '--name', 'jeff']) | ||
.it('runs hello --name jeff', ctx => { | ||
expect(ctx.stdout).to.contain('hello jeff') | ||
it('runs <%- name %> --name oclif', async () => { | ||
const {stdout} = await runCommand('<%- name %> --name oclif') | ||
expect(stdout).to.contain('hello oclif') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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('example hook running mycommand')) | ||
.it('shows a message') | ||
it('shows a message', async () => { | ||
const {stdout} = await runHook('init', {id: 'mycommand'}) | ||
expect(stdout).to.contain('example hook running mycommand') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import {expect} from '@oclif/test' | ||
import {expect} from 'chai' | ||
|
||
import {deleteFolder} from './helper' | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.