Updated Using dojo and dojo class loading in jasmine headless webkit (markdown)
parent
846840de85
commit
40fcb44e77
@ -33,6 +33,8 @@ dojo.require("mystuff.SomethingCool");
|
|||||||
|
|
||||||
dojo knows where to look for mystuff/SomethingCool.js in the load path. You do this by creating a global djConfig object before loading dojo.js, providing two key pieces of information. One is modulePaths, which is how you tell dojo where to find things. The other is baseScriptUri, which tells dojo where its home is. baseScriptUri lets you specify the URL as a file URL, and dojo will load class files using file URLs instead of requiring a server.
|
dojo knows where to look for mystuff/SomethingCool.js in the load path. You do this by creating a global djConfig object before loading dojo.js, providing two key pieces of information. One is modulePaths, which is how you tell dojo where to find things. The other is baseScriptUri, which tells dojo where its home is. baseScriptUri lets you specify the URL as a file URL, and dojo will load class files using file URLs instead of requiring a server.
|
||||||
|
|
||||||
- The third issue is getting dojo to stop trying to load firebug.js, which I couldn't get working. You do this by setting isDebug to false.
|
To create this global djConfig object, I include the test_bootstrap.js in the src_files list before dojo.js, which seems to ensure that test_bootstrap.js is run before dojo.js, thereby configuring dojo correctly.
|
||||||
|
|
||||||
And away you go. You can call dojo.require() in your specs and create instances of dojo classes.
|
- The third issue is getting dojo to stop trying to load firebug.js. You do this by setting isDebug to false.
|
||||||
|
|
||||||
|
And away you go. You can call dojo.require() in your specs and create instances of dojo classes for testing.
|
||||||
|
Loading…
Reference in New Issue
Block a user