Node-Red configuration
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

fakes.js 683B

1234567891011121314151617181920212223242526272829
  1. 'use strict';
  2. var inspect = require('../');
  3. var test = require('tape');
  4. var hasToStringTag = require('has-tostringtag/shams')();
  5. var forEach = require('for-each');
  6. test('fakes', { skip: !hasToStringTag }, function (t) {
  7. forEach([
  8. 'Array',
  9. 'Boolean',
  10. 'Date',
  11. 'Error',
  12. 'Number',
  13. 'RegExp',
  14. 'String'
  15. ], function (expected) {
  16. var faker = {};
  17. faker[Symbol.toStringTag] = expected;
  18. t.equal(
  19. inspect(faker),
  20. '{ [Symbol(Symbol.toStringTag)]: \'' + expected + '\' }',
  21. 'faker masquerading as ' + expected + ' is not shown as one'
  22. );
  23. });
  24. t.end();
  25. });