ignore_missing.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. var browserify = require('../');
  2. var test = require('tap').test;
  3. test('ignoreMissing option', function (t) {
  4. t.test('on browserify', function(t) {
  5. t.plan(1);
  6. var ignored = browserify({
  7. entries: [__dirname + '/ignore_missing/main.js'],
  8. ignoreMissing: true
  9. });
  10. ignored.bundle(function(err) {
  11. t.ok(!err, "bundle completed with missing file ignored");
  12. });
  13. });
  14. t.test('on .bundle', function(t) {
  15. t.plan(1);
  16. var ignored = browserify(__dirname + '/ignore_missing/main.js', {
  17. ignoreMissing: true
  18. });
  19. ignored.bundle(function(err) {
  20. t.ok(!err, "bundle completed with missing file ignored");
  21. });
  22. });
  23. t.test('defaults to false', function (t) {
  24. t.plan(1);
  25. var expected = browserify(__dirname + '/ignore_missing/main.js');
  26. expected.bundle(function(err) {
  27. t.ok(err, 'ignoreMissing was false, an error was raised');
  28. });
  29. });
  30. t.end();
  31. });