Skip to content

Commit

Permalink
tests: add test for --version command
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Jan 25, 2022
1 parent 8398f9d commit 8cb5ca9
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/cmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,20 @@ describe('express(1)', function () {
})
})

describe('--version', function () {
var ctx = setupTestEnvironment(this.fullTitle())

it('should print version', function (done) {
var pkg = fs.readFileSync(path.join(__dirname, '../package.json'), 'utf8')
var ver = JSON.parse(pkg).version
run(ctx.dir, ['--version'], function (err, stdout) {
if (err) return done(err)
assert.strictEqual(stdout.replace(/[\r\n]+/, '\n'), ver + '\n')
done()
})
})
})

describe('--view <engine>', function () {
describe('(no engine)', function () {
var ctx = setupTestEnvironment(this.fullTitle())
Expand Down

0 comments on commit 8cb5ca9

Please sign in to comment.