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

simple.js 669B

123456789101112131415161718192021222324252627282930
  1. var test = require('tap').test;
  2. var promzard = require('../');
  3. test('simple', function (t) {
  4. t.plan(1);
  5. var ctx = { tmpdir : '/tmp' }
  6. var file = __dirname + '/simple.input';
  7. promzard(file, ctx, function (err, output) {
  8. t.same(
  9. {
  10. a : 3,
  11. b : '!2b',
  12. c : {
  13. x : 55,
  14. y : '/tmp/y/file.txt',
  15. }
  16. },
  17. output
  18. );
  19. });
  20. setTimeout(function () {
  21. process.stdin.emit('data', '\n');
  22. }, 100);
  23. setTimeout(function () {
  24. process.stdin.emit('data', '55\n');
  25. }, 200);
  26. });