Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I use Require.js and Buster.js together?
    primarykey
    data
    text
    <p>I'm trying to get started with Buster.js, and I installed both buster and buster-amd, but even so my use of Require.js is causing problems. My buster.js file looks like this:</p> <pre><code>var config = module.exports; config["My tests"] = { autoRun: false, environment: "browser", // as opposed to "node" extensions: [require("buster-amd")], rootPath: "../", sources: ['ext/require/require.js'], tests: ["buster-test/*-test.js"] }; </code></pre> <p>and my test like this:</p> <pre><code>define(['buster-test/buster' ], function(buster) { buster.spec.expose(); // Make some functions global describe("A Fake Test", function () { it("can be instantiated", function () { console.log('test') }); }); buster.run() }); </code></pre> <p>But when I try to run the above, I get:</p> <pre><code>Uncaught exception: ./buster/load-all.js:1 Uncaught ReferenceError: require is not defined TypeError: uncaughtException listener threw error: Cannot read property 'id' of undefined at Object.module.exports.uncaughtException (/usr/lib/node_modules/buster/node_modules/buster-test-cli/lib/runners/browser/progress-reporter.js:42:50) at notifyListener (/usr/lib/node_modules/buster/node_modules/buster-test-cli/node_modules/bane/lib/bane.js:49:35) at Object.object.emit (/usr/lib/node_modules/buster/node_modules/buster-test-cli/node_modules/bane/lib/bane.js:127:17) at Object.module.exports.bane.createEventEmitter.emitCustom (/usr/lib/node_modules/buster/node_modules/buster-test-cli/lib/runners/browser/remote-runner.js:289:14) at /usr/lib/node_modules/buster/node_modules/buster-test-cli/lib/runners/browser/remote-runner.js:92:16 at PubSubClient.on._handler (/usr/lib/node_modules/buster/node_modules/buster-test-cli/node_modules/ramp/lib/pubsub-client.js:73:43) at Object.Faye.Publisher.trigger (/usr/lib/node_modules/buster/node_modules/buster-test-cli/node_modules/ramp/node_modules/faye/node/faye-node.js:385:19) at Object.Faye.extend.Set.Faye.Class.distributeMessage (/usr/lib/node_modules/buster/node_modules/buster-test-cli/node_modules/ramp/node_modules/faye/node/faye-node.js:668:30) at Object.Faye.Client.Faye.Class._deliverMessage (/usr/lib/node_modules/buster/node_modules/buster-test-cli/node_modules/ramp/node_modules/faye/node/faye-node.js:1070:20) at Object.Faye.Client.Faye.Class.receiveMessage (/usr/lib/node_modules/buster/node_modules/buster-test-cli/node_modules/ramp/node_modules/faye/node/faye-node.js:1007:12) </code></pre> <p>Has anyone seen anything like this before, and if so do you have any suggestions as to what I'm doing wrong?</p> <p>P.S. If I remove the <code>extensions:</code> line I get a similar error, except that it complains about <code>define</code> instead of <code>require</code>. So it seems like the failure to find require is happening inside the plug-in ... but I have no idea how to provide Require to the plug-in.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload