bom.js 500 B

12345678910111213141516171819
  1. var browserify = require('../');
  2. var vm = require('vm');
  3. var test = require('tap').test;
  4. test('byte order marker', function (t) {
  5. t.plan(2);
  6. var b = browserify(__dirname + '/bom/hello.js');
  7. b.bundle(function (err, src) {
  8. if (err) t.fail(err);
  9. var c = {
  10. console: { log: function (msg) {
  11. t.equal(msg, 'hello');
  12. } }
  13. };
  14. vm.runInNewContext(src, c);
  15. t.notOk(/\ufeff/.test(src.toString('utf8')));
  16. });
  17. });