Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

Commit

Permalink
fix(test): Ensure requirejs configuration is loaded before any other …
Browse files Browse the repository at this point in the history
…scripts.

In main.js, both require_config and ./lib/app-start are requested at the same time. If app-start is loaded and parsed before require_config, then the shims for underscore and backbone are not defined.

fixes #1478
  • Loading branch information
Shane Tomlinson committed Jul 31, 2014
1 parent 962cf80 commit 10eddcb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
10 changes: 6 additions & 4 deletions app/scripts/main.js
Expand Up @@ -5,10 +5,12 @@
'use strict';

require([
'./require_config',
'./lib/app-start'
'./require_config'
],
function (RequireConfig, AppStart) {
var appStart = new AppStart();
appStart.startApp();
// Ensure config is loaded before trying to load any other scripts.
require(['./lib/app-start'], function (AppStart) {
var appStart = new AppStart();
appStart.startApp();
});
});
10 changes: 6 additions & 4 deletions app/tests/main.js
Expand Up @@ -3,10 +3,12 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

require([
'../scripts/require_config',
'./test_start'
'../scripts/require_config'
],
function (RequireConfig, TestStart) {
function (RequireConfig) {
'use strict';
// don't need to do anything.
// Ensure config is loaded before trying to load any other scripts.
require(['../tests/test_start'], function () {
// nothing to do here.
});
});

0 comments on commit 10eddcb

Please sign in to comment.