Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip bogus pretty print tests only in old node versions #290

Merged
merged 1 commit into from
Apr 16, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();
});
});
};