helpers.js 539 B

1234567891011121314151617
  1. exports.testRunnerPath = require.resolve('./Test').replace(/\.js$/, "");
  2. exports.nodeWrap = function (id) {
  3. var wrapSource = JSON.stringify('_wrap_' + id),
  4. idSource = JSON.stringify(id);
  5. return {
  6. start: "#!/usr/bin/env/node\n" +
  7. "(function(define){\n" +
  8. "define(" + wrapSource + ", function (require) {\n",
  9. end: "require(" + idSource + ");\n" +
  10. "});\n" +
  11. "define.require(" + wrapSource + ");\n" +
  12. "}(" +
  13. require("amdefine") +
  14. "(module)));"
  15. };
  16. };