index.js 737 B

1234567891011121314151617181920212223242526272829
  1. 'use strict';
  2. var test = require('tape');
  3. var semver = require('semver');
  4. var supportsPreserveSymlinks = require('../');
  5. var browser = require('../browser');
  6. test('supportsPreserveSymlinks', function (t) {
  7. t.equal(typeof supportsPreserveSymlinks, 'boolean', 'is a boolean');
  8. t.equal(browser, null, 'browser file is `null`');
  9. t.equal(
  10. supportsPreserveSymlinks,
  11. null,
  12. 'in a browser, is null',
  13. { skip: typeof window === 'undefined' }
  14. );
  15. var expected = semver.satisfies(process.version, '>= 6.2');
  16. t.equal(
  17. supportsPreserveSymlinks,
  18. expected,
  19. 'is true in node v6.2+, false otherwise (actual: ' + supportsPreserveSymlinks + ', expected ' + expected + ')',
  20. { skip: typeof window !== 'undefined' }
  21. );
  22. t.end();
  23. });