-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathcli-test.js
More file actions
executable file
·22 lines (19 loc) · 985 Bytes
/
Copy pathcli-test.js
File metadata and controls
executable file
·22 lines (19 loc) · 985 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
require("../test/example-utils.js").quickInit()
const pkg = require("../package.json")
const cp = require("child_process")
const pwd = __dirname
const output1 = cp.execSync(`cat ${pwd}/data/data.csv | node ${pwd}/../adapters/terminal-adapter.js`, {
encoding: "utf8",
env: { ...process.env, COLUMNS: pkg.defaultTestColumns } // since child process wont inherit process.stdout.columns
})
console.log(output1)
const output2 = cp.execSync(`cat ${pwd}/data/data.json | node ${pwd}/../adapters/terminal-adapter.js --format json`, {
encoding: "utf8",
env: { ...process.env, COLUMNS: pkg.defaultTestColumns } // since child process wont inherit process.stdout.columns
})
console.log(output2)
const output3 = cp.execSync(`cat ${pwd}/data/data-wide.csv | node ${pwd}/../adapters/terminal-adapter.js --options-width 20`, {
encoding: "utf8",
env: { ...process.env, COLUMNS: pkg.defaultTestColumns } // since child process wont inherit process.stdout.columns
})
console.log(output3)