Skip to content

Commit

Permalink
Skip bogus pretty print tests only in old node versions
Browse files Browse the repository at this point in the history
  • Loading branch information
juanjoDiaz committed Apr 16, 2018
1 parent 8326276 commit 67e8d29
Showing 1 changed file with 40 additions and 38 deletions.
78 changes: 40 additions & 38 deletions test/CLI.js
Original file line number Diff line number Diff line change
Expand Up @@ -706,50 +706,52 @@ module.exports = (testRunner, jsonFixtures, csvFixtures) => {

// Pretty print
// TODO Fix this tests in Node < 8
// testRunner.add('should print pretty table', (t) => {
// const opts = ' --pretty';
if (Number(process.versions.node[0]) < 8) return;

// child_process.exec(cli + '-i ' + getFixturePath('/json/default.json') + opts, (err, stdout, stderr) => {
// t.notOk(stderr);
// const csv = stdout;
// t.equal(csv, csvFixtures.prettyprint);
// t.end();
// });
// });
testRunner.add('should print pretty table', (t) => {
const opts = ' --pretty';

// testRunner.add('should print pretty table without header', (t) => {
// const opts = ' --no-header --pretty';
child_process.exec(cli + '-i ' + getFixturePath('/json/default.json') + opts, (err, stdout, stderr) => {
t.notOk(stderr);
const csv = stdout;
t.equal(csv, csvFixtures.prettyprint);
t.end();
});
});

// child_process.exec(cli + '-i ' + getFixturePath('/json/default.json') + opts, (err, stdout, stderr) => {
// t.notOk(stderr);
// const csv = stdout;
// t.equal(csv, csvFixtures.prettyprintWithoutHeader);
// t.end();
// });
// });
testRunner.add('should print pretty table without header', (t) => {
const opts = ' --no-header --pretty';

// testRunner.add('should print pretty table without streaming', (t) => {
// const opts = ' --fields carModel,price,color'
// + ' --no-streaming --pretty ';
child_process.exec(cli + '-i ' + getFixturePath('/json/default.json') + opts, (err, stdout, stderr) => {
t.notOk(stderr);
const csv = stdout;
t.equal(csv, csvFixtures.prettyprintWithoutHeader);
t.end();
});
});

// child_process.exec(cli + '-i ' + getFixturePath('/json/default.json') + opts, (err, stdout, stderr) => {
// t.notOk(stderr);
// const csv = stdout;
// t.equal(csv, csvFixtures.prettyprint);
// t.end();
// });
// });
testRunner.add('should print pretty table without streaming', (t) => {
const opts = ' --fields carModel,price,color'
+ ' --no-streaming --pretty ';

// testRunner.add('should print pretty table without streaming and without header', (t) => {
// const opts = ' --fields carModel,price,color'
// + ' --no-streaming --no-header --pretty ';
child_process.exec(cli + '-i ' + getFixturePath('/json/default.json') + opts, (err, stdout, stderr) => {
t.notOk(stderr);
const csv = stdout;
t.equal(csv, csvFixtures.prettyprint);
t.end();
});
});

// child_process.exec(cli + '-i ' + getFixturePath('/json/default.json') + opts, (err, stdout, stderr) => {
// t.notOk(stderr);
// const csv = stdout;
// t.equal(csv, csvFixtures.prettyprintWithoutHeader);
// t.end();
// });
// });
testRunner.add('should print pretty table without streaming and without header', (t) => {
const opts = ' --fields carModel,price,color'
+ ' --no-streaming --no-header --pretty ';

child_process.exec(cli + '-i ' + getFixturePath('/json/default.json') + opts, (err, stdout, stderr) => {
t.notOk(stderr);
const csv = stdout;
t.equal(csv, csvFixtures.prettyprintWithoutHeader);
t.end();
});
});
};

0 comments on commit 67e8d29

Please sign in to comment.