Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

tests.js 1.4KB

123456789101112131415161718192021222324252627282930313233343536
  1. /* jscs:disable requireUseStrict */
  2. /* eslint strict: 0, max-statements: 0 */
  3. module.exports = function (theGlobal, t) {
  4. t.equal(typeof theGlobal, 'object', 'is an object');
  5. t.test('built-in globals', function (st) {
  6. st.equal(theGlobal.Math, Math, 'Math is on the global');
  7. st.equal(theGlobal.JSON, JSON, 'JSON is on the global');
  8. st.equal(theGlobal.String, String, 'String is on the global');
  9. st.equal(theGlobal.Array, Array, 'Array is on the global');
  10. st.equal(theGlobal.Number, Number, 'Number is on the global');
  11. st.equal(theGlobal.Boolean, Boolean, 'Boolean is on the global');
  12. st.equal(theGlobal.Object, Object, 'Object is on the global');
  13. st.equal(theGlobal.Function, Function, 'Function is on the global');
  14. st.equal(theGlobal.Date, Date, 'Date is on the global');
  15. st.equal(theGlobal.RegExp, RegExp, 'RegExp is on the global');
  16. if (typeof Symbol === 'undefined') {
  17. st.comment('# SKIP Symbol is not supported');
  18. } else {
  19. st.equal(theGlobal.Symbol, Symbol, 'Symbol is on the global');
  20. }
  21. st.end();
  22. });
  23. t.test('custom property', function (st) {
  24. var key = 'random_custom_key_' + new Date().getTime();
  25. var semaphore = {};
  26. /* eslint no-eval: 1 */
  27. eval(key + ' = semaphore;');
  28. st.equal(theGlobal[key], semaphore, 'global variable ends up on the global object');
  29. delete theGlobal[key]; // eslint-disable-line no-param-reassign
  30. st.end();
  31. });
  32. };