test(cli): run cli tests only on node >= 0.12

This commit is contained in:
Estevão Soares dos Santos 2015-07-13 05:39:05 +01:00
parent 1a764b0280
commit d8111d1791
3 changed files with 13 additions and 9 deletions

View File

@ -2,6 +2,7 @@ language: node_js
node_js:
- "0.8"
- "0.10"
- "0.12"
before_install:
- '[ "${TRAVIS_NODE_VERSION}" != "0.8" ] || npm install -g npm@1.4.28'

View File

@ -51,6 +51,7 @@
"js-beautify": "^1.5.6",
"load-grunt-tasks": "^3.2.0",
"quiet-grunt": "^0.2.3",
"semver": "^5.0.0",
"sinon": "^1.14.1",
"source-map-support": "^0.2.9"
},

View File

@ -1,14 +1,16 @@
var execSync = require('child_process').execSync,
cmd = 'node bin/showdown.js';
var semver = require('semver'),
cmd = 'node bin/showdown.js';
describe('showdown cli', function () {
'use strict';
it('basic stdin stdout', function () {
var otp = execSync(cmd + ' makehtml', {
encoding: 'utf8',
input: '**foo**'
if (semver.gt(process.versions.node, '0.12.0')) {
var execSync = require('child_process').execSync;
it('basic stdin stdout', function () {
var otp = execSync(cmd + ' makehtml', {
encoding: 'utf8',
input: '**foo**'
});
otp.trim().should.equal('<p><strong>foo</strong></p>');
});
otp.trim().should.equal('<p><strong>foo</strong></p>');
});
}
});