Skip to content

Commit

Permalink
fix: use new test format
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Jan 30, 2018
1 parent ff340da commit 67fe975
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
10 changes: 6 additions & 4 deletions templates/command.test.js.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ describe(command, () => {
test
.stdout()
.command([command])
.do(ctx => expect(ctx.stdout).to.equal('hello world from <%- name %>!\n'))
.it()
.it('runs hello', ctx => {
expect(ctx.stdout).to.contain('hello world from <%- name %>!')
})

test
.stdout()
.command([command, '--name', 'jeff'])
.do(ctx => expect(ctx.stdout).to.equal('hello jeff from <%- name %>!\n'))
.it()
.it('runs hello --name jeff', ctx => {
expect(ctx.stdout).to.contain('hello jeff from <%- name %>!')
})
})
10 changes: 6 additions & 4 deletions templates/command.test.ts.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ describe(command, () => {
test
.stdout()
.command([command])
.do(ctx => expect(ctx.stdout).to.contain('hello world from <%- name %>!'))
.it()
.it('runs hello', ctx => {
expect(ctx.stdout).to.contain('hello world from <%- name %>!')
})

test
.stdout()
.command([command, '--name', 'jeff'])
.do(ctx => expect(ctx.stdout).to.contain('hello jeff from <%- name %>!'))
.it()
.it('runs hello --name jeff', ctx => {
expect(ctx.stdout).to.contain('hello jeff from <%- name %>!')
})
})
10 changes: 6 additions & 4 deletions templates/single/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ describe('command', () => {
test
.stdout()
.do(() => cmd.run([]))
.do(ctx => expect(ctx.stdout).to.equal('hello world!\n'))
.it('says hello world!')
.it('says hello world!', ctx => {
expect(ctx.stdout).to.equal('hello world!\n')
})

test
.stdout()
.do(() => cmd.run(['--name', 'jeff']))
.do(ctx => expect(ctx.stdout).to.equal('hello jeff!\n'))
.it('says hello jeff!')
.it('says hello jeff!', ctx => {
expect(ctx.stdout).to.equal('hello jeff!\n')
})
})

0 comments on commit 67fe975

Please sign in to comment.