Skip to content

Commit

Permalink
fix: use strings instead of variable
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Feb 2, 2018
1 parent 0ee469a commit 8e8b9a7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
8 changes: 3 additions & 5 deletions templates/test/command.test.js.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@ const {expect, test} = require('@anycli/test')
const cmd = require('..')
<%_ } _%>

const command = '<%- name %>'

describe(command, () => {
describe('<%- name %>', () => {
test
.stdout()
<%_ if (type === 'single') { _%>
.do(() => cmd.run([]))
<%_ } else { _%>
.command([command])
.command(['<%- name %>'])
<%_ } _%>
.it('runs hello', ctx => {
expect(ctx.stdout).to.contain('hello world from <%- name %>!')
Expand All @@ -22,7 +20,7 @@ describe(command, () => {
<%_ if (type === 'single') { _%>
.do(() => cmd.run(['--name', 'jeff']))
<%_ } else { _%>
.command([command, '--name', 'jeff'])
.command(['<%- name %>', '--name', 'jeff'])
<%_ } _%>
.it('runs hello --name jeff', ctx => {
expect(ctx.stdout).to.contain('hello jeff from <%- name %>!')
Expand Down
8 changes: 3 additions & 5 deletions templates/test/command.test.ts.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@ import {expect, test} from '@anycli/test'
import cmd = require('../src')
<%_ } _%>

const command = '<%- name %>'

describe(command, () => {
describe('<%- name %>', () => {
test
.stdout()
<%_ if (type === 'single') { _%>
.do(() => cmd.run([]))
<%_ } else { _%>
.command([command])
.command(['<%- name %>'])
<%_ } _%>
.it('runs hello', ctx => {
expect(ctx.stdout).to.contain('hello world from <%- name %>!')
Expand All @@ -23,7 +21,7 @@ describe(command, () => {
<%_ if (type === 'single') { _%>
.do(() => cmd.run(['--name', 'jeff']))
<%_ } else { _%>
.command([command, '--name', 'jeff'])
.command(['<%- name %>', '--name', 'jeff'])
<%_ } _%>
.it('runs hello --name jeff', ctx => {
expect(ctx.stdout).to.contain('hello jeff from <%- name %>!')
Expand Down

0 comments on commit 8e8b9a7

Please sign in to comment.