Skip to content

Commit

Permalink
Add support for RequireJS
Browse files Browse the repository at this point in the history
Fixes #1 and #18.
  • Loading branch information
kevva committed Apr 28, 2015
1 parent dee52f6 commit eadab44
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
6 changes: 3 additions & 3 deletions generators/app/templates/_bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"private": true,
"dependencies": {
"chai": "~2.3.0",
"mocha": "~2.2.4"
},
"devDependencies": {}
"mocha": "~2.2.4"<% if (options.rjs) { %>,
"requirejs": "~2.1.10"<% } %>
}
}
13 changes: 11 additions & 2 deletions generators/app/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,21 @@
var assert = chai.assert;
var expect = chai.expect;
var should = chai.should();
</script>
</script><% if (options.rjs) { %>
<script src="bower_components/requirejs/require.js"></script>
<script>
require([
// include spec files here
'spec/test'
], function () {
mocha.run();
});
</script><% } else { %>
<!-- bower:js -->
<!-- endbower -->
<!-- include source files here... -->
<!-- include spec files here... -->
<script src="spec/test.js"></script>
<script>mocha.run();</script>
<script>mocha.run();</script><% } %>
</body>
</html>

0 comments on commit eadab44

Please sign in to comment.