dynamic.js 653 B

1234567891011121314151617181920
  1. if (typeof define !== 'function') { var define = (require('../../../amdefine'))(module, require); }
  2. //Just testing a plain exports case.
  3. define(function (require) {
  4. var dynamic = {
  5. count: 0,
  6. action: function () {
  7. dynamic.count += 1;
  8. //Test that dynamic require is not synchronous. If it was, this
  9. //would add two to the counter, instead of just one.
  10. require(['../addTwo'], function (addTwo) {
  11. console.log('dynamic require should fire after TEST SUMMARY is shown.');
  12. dynamic.count += addTwo();
  13. });
  14. }
  15. };
  16. return dynamic;
  17. });