Skip to content

Commit 52fe059

Browse files
Attempting to setup qunit bower etc for testing
1 parent 9e2d378 commit 52fe059

File tree

6 files changed

+31
-8
lines changed

6 files changed

+31
-8
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
language: node_js
22
node_js:
33
- 0.10
4+
before_script:
5+
- node_modules/bower/bin/bower install

Gruntfile.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,19 @@ module.exports = function(grunt) {
4646
module: true
4747
}
4848
}
49-
}
49+
},
50+
qunit: {
51+
files: ['test/index.html']
52+
}
5053
});
5154

5255

5356
// grunt.loadNpmTasks('grunt-contrib-uglify');
5457
grunt.loadNpmTasks('grunt-requirejs');
5558
grunt.loadNpmTasks('grunt-contrib-jshint');
59+
grunt.loadNpmTasks('grunt-contrib-qunit');
5660

57-
grunt.registerTask('test', ['requirejs', 'jshint']);
61+
grunt.registerTask('test', ['requirejs', 'jshint', 'qunit']);
5862
grunt.registerTask('default', ['requirejs', 'jshint']);
5963

6064

bower.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@
2626
"tests"
2727
],
2828
"devDependencies": {
29-
"almond": "~0.2.9"
30-
},
31-
"dependencies": {
32-
33-
}
29+
"almond": "~0.2.9",
30+
"qunit": "~1.16.0"
31+
},
32+
"dependencies": {}
3433
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
"grunt": "~0.4.5",
2525
"grunt-contrib-jshint": "^0.10.0",
2626
"grunt-contrib-nodeunit": "~0.4.1",
27-
"grunt-requirejs": "*"
27+
"grunt-requirejs": "*",
28+
"grunt-contrib-qunit": "*"
2829
},
2930
"author": "Andreas Åkre Solberg",
3031
"license": "Simplified BSD Licence http://opensource.org/licenses/BSD-2-Clause",

test/index.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>JSO Test (QUnit)</title>
6+
<link rel="stylesheet" href="//code.jquery.com/qunit/qunit-1.16.0.css">
7+
</head>
8+
<body>
9+
<div id="qunit"></div>
10+
<div id="qunit-fixture"></div>
11+
<script src="//code.jquery.com/qunit/qunit-1.16.0.js"></script>
12+
<script src="tests.js"></script>
13+
</body>
14+
</html>

test/tests.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
QUnit.test( "hello test", function( assert ) {
2+
assert.ok( 1 == "1", "Passed!" );
3+
});

0 commit comments

Comments
 (0)