amd.js 354 B

123456789101112131415
  1. var tap = require('tap');
  2. var test = tap.test;
  3. test('amd', function(t) {
  4. global.define = define;
  5. define.amd = true;
  6. var defined = null;
  7. function define(stuff) {
  8. defined = stuff;
  9. }
  10. var fromRequire = require('../');
  11. t.ok(defined, 'amd function called');
  12. t.equal(fromRequire, defined, 'amd stuff same as require stuff');
  13. t.end();
  14. });