Skip to content

Commit f3dd12e

Browse files
committed
Add test to ensure NestedModel is attached to Backbone when using require()
Introduces tape and a new grunt task, because mixing in this type of test with qunit seemed to be a pain. This separates the two environments while keeping consistent with a method to run tests.
1 parent 73dd489 commit f3dd12e

3 files changed

Lines changed: 16 additions & 2 deletions

File tree

Gruntfile.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ module.exports = function(grunt) {
2424
qunit: {
2525
index: ['test/index.html']
2626
},
27+
tape: {
28+
files: ['test/tape-*.js']
29+
},
2730
watch: {
2831
files: ['<config:lint.files>', 'test/**'],
2932
tasks: ['jshint', 'qunit']
@@ -32,7 +35,8 @@ module.exports = function(grunt) {
3235

3336
grunt.loadNpmTasks('grunt-contrib-jshint');
3437
grunt.loadNpmTasks('grunt-contrib-qunit');
38+
grunt.loadNpmTasks('grunt-tape');
3539

3640
// Default task.
37-
grunt.registerTask('default', ['jshint', 'qunit']);
41+
grunt.registerTask('default', ['jshint', 'qunit', 'tape']);
3842
};

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@
1515
"grunt": "~0.4.1",
1616
"grunt-contrib-qunit": "~0.2.2",
1717
"grunt-contrib-jshint": "~0.6.4",
18+
"grunt-tape": "0.0.2",
1819
"grunt-contrib-watch": "~0.5.3",
19-
"jslitmus": "~0.1.0"
20+
"jslitmus": "~0.1.0",
21+
"tape": "~2.3.2"
2022
},
2123
"peerDependencies": {
2224
"grunt-cli": "*",

test/tape-require.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
var test = require('tape');
2+
var Backbone = require('backbone');
3+
require('../backbone-nested');
4+
5+
test('require backbone-nested should attach to Backbone', function(t) {
6+
t.ok(Backbone.NestedModel);
7+
t.end();
8+
});

0 commit comments

Comments
 (0)