Problems with requirejs

132 views
Skip to first unread message

rv.maksim

unread,
Mar 29, 2012, 4:05:26 PM3/29/12
to Buster.JS
Hello.
I have some problems with require.js in browser.
When i run test I get error 'Uncaught exception: require is not a
function'.

source buster.js:
var config = module.exports;

config["AMD test"] = {
autoRun:false,
env: "browser",
rootPath: "../",
libs: ["src/require.js"],
tests: ["tests/**/*_spec.js"]
};

source test file:

(function (global) {
var assert = global.assert,
buster = global.buster;

/**
* load test module
*/

buster.testCase("I am a testcase", function (run) {

require(["something"], function (something) {
run({
"here's the test": function () {}
});
});

});

} (this));


What I do wrong?

Thanks.

Christian Johansen

unread,
Mar 31, 2012, 6:37:33 PM3/31/12
to bust...@googlegroups.com
Hi,

Well, we're currently working on improving the AMD situation. What version of buster is this? (buster --version)

Christian
--
MVH
Christian

Maksim Ryzhikov

unread,
Apr 1, 2012, 6:15:48 AM4/1/12
to bust...@googlegroups.com
Hi,

Thanks for the answer.

buster --version:
  Buster.JS version 0.4.6 beta2

Christian Johansen

unread,
Apr 7, 2012, 6:59:20 AM4/7/12
to bust...@googlegroups.com
Are you sure the path to require.js is correct?

C
--
MVH
Christian

Maksim Ryzhikov

unread,
Apr 7, 2012, 1:32:31 PM4/7/12
to bust...@googlegroups.com
my directory structure:

jk/spec/buster.js
/src/require.js
/tests/mytest_spec.js
index.html

Maksim Ryzhikov

unread,
Apr 7, 2012, 1:33:36 PM4/7/12
to bust...@googlegroups.com
sorry. correct directory structure=)


/spec/buster.js
/src/require.js
/tests/mytest_spec.js
index.html

rv.maksim

unread,
Apr 16, 2012, 5:09:39 AM4/16/12
to Buster.JS
Problem in not require.js. When page is loading in frame ('session')
defined function 'define'.
function define (cb) {
when = cb;
};

bundle-0.3.1.js
```
var when; function define(cb) { when = cb(); }/** @license MIT License
(c) copyright B Cavalier & J Hann */
```

In require.js check if 'define' is defined then it thinks that this is
AMD loader.

Christian Johansen

unread,
Apr 16, 2012, 5:43:48 PM4/16/12
to bust...@googlegroups.com
Yeah, sorry, this is actually a known problem, I had just forgotten about it. I'm cutting a new release probably tomorrow, should fix your issues.
--
MVH
Christian
Reply all
Reply to author
Forward
0 new messages