[Pkg-javascript-commits] [node-tap] 78/186: a unit test for t.spawn()
Bastien Roucariès
rouca at moszumanska.debian.org
Fri Dec 1 16:40:46 UTC 2017
This is an automated email from the git hooks/post-receive script.
rouca pushed a commit to branch master
in repository node-tap.
commit 5687c7441d2d366fd1f219e7f853e18101a846e8
Author: isaacs <i at izs.me>
Date: Fri Nov 10 10:10:52 2017 -0800
a unit test for t.spawn()
---
unit/test.js | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/unit/test.js b/unit/test.js
index b3b1b47..20776dd 100644
--- a/unit/test.js
+++ b/unit/test.js
@@ -825,5 +825,25 @@ t.test('addAssert', t => {
return t.end()
})
+t.test('spawn', t => {
+ const fs = require('fs')
+ const path = require('path')
+ const okjs = path.resolve(__dirname, '../__ok.js')
+ t.teardown(() => fs.unlinkSync(okjs))
+ fs.writeFileSync(okjs, "require('./').pass('this is fine')\n")
+ t.spawn(process.execPath, okjs)
+ t.spawn(process.execPath, okjs, 'a string as options')
+ t.spawn(process.execPath, okjs, { name: 'a name as an option' })
+
+ t.test('kitty pipe', t => {
+ t.on('spawn', t =>
+ t.proc.stdin.end('TAP version 13\n1..1\nok\n'))
+ t.spawn('cat', [], { stdio: 'pipe' })
+ t.spawn('cat', null, { stdio: 'pipe' }, 'aggreeable kitten')
+ t.end()
+ })
+
+ t.end()
+})
+
t.test('snapshots')
-t.test('spawn')
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-tap.git
More information about the Pkg-javascript-commits
mailing list