mirror of
https://github.com/davidmarkclements/0x.git
synced 2026-01-18 14:38:23 +00:00
* moved to node:test Signed-off-by: Matteo Collina <hello@matteocollina.com> * updated linting Signed-off-by: Matteo Collina <hello@matteocollina.com> * updated readme Signed-off-by: Matteo Collina <hello@matteocollina.com> --------- Signed-off-by: Matteo Collina <hello@matteocollina.com>
15 lines
511 B
JavaScript
15 lines
511 B
JavaScript
const { exec } = require('child_process')
|
|
const { test } = require('node:test')
|
|
const assert = require('node:assert')
|
|
const fs = require('fs')
|
|
|
|
test('should be able to profile commands that expect stdin', async () => {
|
|
return new Promise((resolve, reject) => {
|
|
exec('./cmd.js test/fixture/stdin.js < test/fixture/stdin.js', (error, stdout, stderr) => {
|
|
if (error) return reject(error)
|
|
assert.strictEqual(stdout, fs.readFileSync('test/fixture/stdin.js', 'utf8'))
|
|
resolve()
|
|
})
|
|
})
|
|
})
|