Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura

validate.js 469B

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