null.js 779 B

1234567891011121314151617181920212223242526272829
  1. 'use strict';
  2. var test = require('tape-catch');
  3. var assert = require('assert');
  4. var Vinyl = require('vinyl');
  5. var td = require('testdouble');
  6. var minify = require('../lib/minify');
  7. test('null Vinyl should passthrough', function(t) {
  8. var testFile = new Vinyl({
  9. cwd: '/home/terin/broken-promises/',
  10. base: '/home/terin/broken-promises/test',
  11. path: '/home/terin/broken-promises/test/test1.js',
  12. contents: null
  13. });
  14. var uglify = td.object(['minify']);
  15. var logger = td.object(['warn']);
  16. var subject = minify(uglify, logger)({});
  17. var file = subject(testFile);
  18. assert.strictEqual(file, testFile);
  19. td.verify(logger.warn(), {times: 0, ignoreExtraArgs: true});
  20. td.verify(uglify.minify(), {times: 0, ignoreExtraArgs: true});
  21. td.reset();
  22. t.end();
  23. });