Commit ea6780df authored by Stas SUȘCOV's avatar Stas SUȘCOV

Move specs runner/initializer to a separate file.

parent 99282a82
......@@ -21,27 +21,6 @@ define( 'app', [
VERSION: '0.2-omfg',
// Sets up mocha to run some integration tests
specsRunner: function( chai ) {
// Create placeholder for mocha output
// TODO: Make this shit look better and inside body
$( document.body ).before( '<div id="mocha"></div>' );
// Setup mocha and expose chai matchers
window.expect = chai.expect;
mocha.setup('bdd');
// Load testsuite
require([
'app/specs/models/store',
'app/specs/views/basic_acceptance',
'app/specs/controllers/todos'
], function() {
mocha.run().globals( [ '$', 'Ember', 'Todos' ] );
}
);
},
// Constructor
init: function() {
this._super();
......@@ -56,7 +35,7 @@ define( 'app', [
// Run specs if asked
if ( location.hash.match( /specs/ ) ) {
require( [ 'chai', 'mocha' ], this.specsRunner );
require( [ 'app/specs/helper' ] );
}
}
});
......
define( 'app/specs/helper', [ 'chai', 'mocha' ],
/**
* Specs Runner
*/
function( chai ) {
// Create placeholder for mocha output
// TODO: Make this shit look better and inside body
$( document.body ).before( '<div id="mocha"></div>' );
// Setup mocha and expose chai matchers
window.expect = chai.expect;
mocha.setup('bdd');
// Load testsuite
require([
'app/specs/models/store',
'app/specs/views/basic_acceptance',
'app/specs/controllers/todos'
], function() {
mocha.run().globals( [ '$', 'Ember', 'Todos' ] );
});
}
);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment