Including dojo

260 views
Skip to first unread message

FredrikF

unread,
May 2, 2012, 1:00:18 PM5/2/12
to Buster.JS
Hi,

Trying to include the current version of dojo (1.7.2) with its AMD
loader for my tests, but get an error like this:

Uncaught exception: xhrFailed
Uncaught exception: cb is not a function
Firefox 12.0 OS X: E
Error: Firefox 12.0 OS X tests for myRandomTestFile My simple test
ReferenceError: require is not defined

It looks a bit like the require.js issue discussed on
http://groups.google.com/group/busterjs/browse_thread/thread/f6065b4e01888d4d

I have activated firebug on the browser slave with its net tab. Here I
can see that it does find dojo.js, but also tries to request the file

http://localhost:1111/sessions/6e085f5a-5996-4775-98c7-eaf43674b190/resources/dojo/main.js

which fails with a 404.

All help is welcome, cheers!

August Lilleaas

unread,
May 2, 2012, 2:20:25 PM5/2/12
to bust...@googlegroups.com
Can you post the relevant files, such as your config file?

Maxim Lacrima

unread,
May 3, 2012, 2:22:41 AM5/3/12
to bust...@googlegroups.com
Hi!

Take a look at buster-amd extension: https://github.com/busterjs/buster-amd

There is a demo project with configuration file that will help you get started. But this extension currently doesn't work with buster-static.

I also use dojo 1.7 amd loader and here is my config (note that you will also need to define and load dojoConfig to be able to properly load modules):

// test/buster.js
var config = module.exports;
config['my_proj'] = {
    environment: 'browser',
    rootPath: '../',
    sources: ['**/*.js'],
    tests: ['**/*_test.js'],
    libs: ['test/dojoConfig.js', 'lib/dtk/dojo/dojo.js'],
    extensions: [require('buster-amd')]
};

// test/dojoConfig.js
var dojoConfig = {
    async: true,
    tlmSiblingOfDojo: false,
    baseUrl: '.',
    packages: [
        { name: 'dojo', location: 'lib/dtk/dojo' },
        { name: 'dijit', location: 'lib/dtk/dijit' } ]
};

--
with regards,
Maxim

Christian Johansen

unread,
May 3, 2012, 2:40:42 AM5/3/12
to bust...@googlegroups.com
If anyone would want to volunteer to write some docs on using Buster for async stuff, AMD and/or Dojo in particular, let me know, and I'd be happy to help put it up.

Christian
--
MVH
Christian
Reply all
Reply to author
Forward
0 new messages