test.js 382 B

1234567891011121314151617181920212223
  1. /**
  2. * Module dependencies.
  3. */
  4. var assert = require('assert');
  5. var global;
  6. try {
  7. // component
  8. global = require('global');
  9. } catch (e) {
  10. // node.js
  11. global = require('../');
  12. }
  13. describe('global', function () {
  14. it('should return the `global` object', function () {
  15. var str = String(global);
  16. assert('[object global]' == str || '[object Window]' == str);
  17. });
  18. });