tr_err.js 588 B

123456789101112131415161718192021
  1. var mdeps = require('../');
  2. var test = require('tap').test;
  3. var JSONStream = require('JSONStream');
  4. var packer = require('browser-pack');
  5. var through = require('through2');
  6. var path = require('path');
  7. test('transform', function (t) {
  8. t.plan(1);
  9. var p = mdeps({
  10. transform: function (file) {
  11. return through(function () {
  12. this.emit('error', new Error('rawr'));
  13. });
  14. }
  15. });
  16. p.on('error', function (err) {
  17. t.ok(/tr_sh[\\\/]main\.js/.test(err));
  18. });
  19. p.end(path.join(__dirname, '/files/tr_sh/main.js'));
  20. });