Internal configuration is not processed.

I am trying to test the Require.js project using Intern. I am experiencing errors in my tests where jQuery is not detected when loading jQuery plugins. My bootloader configuration looks like this:

loader: { // Aliased paths paths: { 'dt': 'dt', 'jq': 'jquery', 'jquery': 'jquery/jquery-1.8.3', 'jquerymx': 'jquery/jquerymx-3.2.custom', 'jquery.ui': 'jquery/jquery-ui-1.9.2.custom.min', 'jquery.ui.widget': 'jquery/jquery.ui.widget', 'jquery.jscrollpane': 'jquery/jquery.jscrollpane.min.edit', 'jquery.colorbox': 'jquery/jquery.colorbox-min', 'jquery.selectbox': 'jquery/jquery.selectbox-0.2.min.edit', 'jquery.base64': 'jquery/jquery.base64', 'jquery.cookie': 'jquery/jquery.cookie', 'jquery.urldecoder': 'jquery/jquery.urldecoder.min', 'jquery.fileupload': 'jquery/jquery.fileupload', 'jquery.history': 'history/scripts/compressed/history.adapter.jquery', 'openajax': 'openajax_2.0.7/OpenAjaxUnmanagedHub', 'zeroclipboard': 'zeroclipboard/ZeroClipboard' }, // Plugin mappings map: { '*': { 'css': 'requirejs/require-css/css', 'text': 'requirejs/text' } }, // Shims for non-AMD libraries, mainly jQuery plugins shim: { 'openajax': { exports: 'OpenAjax' }, 'zeroclipboard': { exports: 'ZeroClipboard' }, 'jquerymx': ['jquery'], 'jquery.ui': ['jquery'], 'jquery.ui.widget': ['jquery'], 'jquery.jscrollpane': ['jquery'], 'jquery.colorbox': ['jquery'], 'jquery.selectbox': ['jquery'], 'jquery.base64': ['jquery'], 'jquery.cookie': ['jquery'], 'jquery.urldecoder': ['jquery'], 'jquery.fileupload': ['jquery'], 'jquery.history': [ 'jquery', 'history/scripts/compressed/history', 'history/scripts/compressed/history.html4' ] } } 

I checked to make sure jQuery and my other dependencies load, and they are there, but not in the correct order. Does the AMD Dojo loader, which uses Intern, not handle the gasket configuration?

+7
source share
2 answers

The problem is that the AMD bootloader used by the trainee does not currently implement the AMD specification shim configuration property. I really did not know that this was part of the standard until you asked this question.

At the moment, you can run functional tests using another AMD bootloader via Intern, but at the moment it would be difficult to run unit tests on a local computer.

+3
source

All I had to do was to specify useLoader config in require.js and poof. I had the familiar shim configuration and path configuration that I use in my application. Bam.

+1
source

All Articles