Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/promzard/test/validate.js')
-rw-r--r--node_modules/promzard/test/validate.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/node_modules/promzard/test/validate.js b/node_modules/promzard/test/validate.js
new file mode 100644
index 000000000..a12068149
--- /dev/null
+++ b/node_modules/promzard/test/validate.js
@@ -0,0 +1,20 @@
+
+var promzard = require('../')
+var test = require('tap').test
+
+test('validate', function (t) {
+ t.plan(2)
+ var ctx = { tmpdir : '/tmp' }
+ var file = __dirname + '/validate.input'
+ promzard(file, ctx, function (er, found) {
+ t.ok(!er)
+ var wanted = { name: 'cool' }
+ t.same(found, wanted)
+ })
+ setTimeout(function () {
+ process.stdin.emit('data', 'not cool\n')
+ }, 100)
+ setTimeout(function () {
+ process.stdin.emit('data', 'cool\n')
+ }, 200)
+})