• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1
2var promzard = require('../')
3var test = require('tap').test
4
5test('validate', function (t) {
6  t.plan(2)
7  var ctx = { tmpdir : '/tmp' }
8  var file = __dirname + '/validate.input'
9  promzard(file, ctx, function (er, found) {
10    t.ok(!er)
11    var wanted = { name: 'cool' }
12    t.same(found, wanted)
13  })
14  setTimeout(function () {
15    process.stdin.emit('data', 'not cool\n')
16  }, 100)
17  setTimeout(function () {
18    process.stdin.emit('data', 'cool\n')
19  }, 200)
20})
21