Skip to content

Commit 5e0ac66

Browse files
committed
adding specrunner and its build config for testing in browser
1 parent fc49b45 commit 5e0ac66

5 files changed

Lines changed: 52 additions & 35 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
Thumbs.db
88
.DS_Store
99
/node_modules/
10+
.grunt/

Gruntfile.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,18 +80,16 @@ module.exports = function(grunt) {
8080
test: {
8181
options: {
8282
port: 8041,
83-
open: 'http://localhost:8041/SpecRunner.html',
84-
base: [
85-
"scripts",
86-
"test"
87-
]
83+
open: 'http://localhost:8041/_SpecRunner.html',
84+
base: "."
8885
}
8986
}
9087
},
9188

9289
jasmine: {
93-
src: 'scripts/**/*.js',
90+
scripts: 'scripts/**/*.js',
9491
options: {
92+
build: true,
9593
specs: 'test/*Spec.js',
9694
helpers: 'test/*Helper.js',
9795
vendor: [
@@ -153,12 +151,12 @@ module.exports = function(grunt) {
153151
buildType = "scss";
154152
}
155153

156-
grunt.task.run(["newer:jshint", "test", buildType]);
154+
grunt.task.run(["newer:jshint", "jasmine:scripts", buildType]);
157155
});
158156

159157
grunt.registerTask("test", [
160-
"connect:test",
161-
"jasmine"
158+
"jasmine:scripts:build",
159+
"connect:test"
162160
]);
163161

164162
grunt.registerTask("serve", function(target){

_SpecRunner.html

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>Jasmine Spec Runner</title>
6+
<link rel="shortcut icon" type="image/png" href=".grunt/grunt-contrib-jasmine/jasmine_favicon.png">
7+
8+
<link rel="stylesheet" type="text/css" href=".grunt/grunt-contrib-jasmine/jasmine.css">
9+
10+
11+
</head>
12+
<body>
13+
14+
15+
<script src=".grunt/grunt-contrib-jasmine/es5-shim.js"></script>
16+
17+
<script src=".grunt/grunt-contrib-jasmine/jasmine.js"></script>
18+
19+
<script src=".grunt/grunt-contrib-jasmine/jasmine-html.js"></script>
20+
21+
<script src=".grunt/grunt-contrib-jasmine/json2.js"></script>
22+
23+
<script src=".grunt/grunt-contrib-jasmine/boot.js"></script>
24+
25+
<script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
26+
27+
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
28+
29+
<script src="test/*Helper.js"></script>
30+
31+
<script src="scripts/material.js"></script>
32+
33+
<script src="scripts/ripples.js"></script>
34+
35+
<script src="test/materialSpec.js"></script>
36+
37+
<script src="test/ripplesSpec.js"></script>
38+
39+
<script src=".grunt/grunt-contrib-jasmine/reporter.js"></script>
40+
41+
42+
</body>
43+
</html>

test/SpecRunner.html

Lines changed: 0 additions & 26 deletions
This file was deleted.

test/materialSpec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
describe('Material', function (){
44

5+
//Dummy test just to ensure tests are accurately configured
56
it('jquery should be loaded', function () {
67
expect($).toBeDefined();
78
});

0 commit comments

Comments
 (0)