Skip to content

Commit 806d34e

Browse files
committed
Added mocha grunt tasks for both server- (NodeJS) and client-side (PhantomJS) tests.
1 parent eb72edb commit 806d34e

File tree

7 files changed

+166
-87
lines changed

7 files changed

+166
-87
lines changed

Gruntfile.js

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/*
2+
* JavaScript Load Image Gruntfile
3+
* https://github.com/blueimp/JavaScript-Load-Image
4+
*
5+
* Copyright 2013, Sebastian Tschan
6+
* https://blueimp.net
7+
*
8+
* Licensed under the MIT license:
9+
* http://www.opensource.org/licenses/MIT
10+
*/
11+
12+
/*global module */
13+
14+
module.exports = function (grunt) {
15+
'use strict';
16+
17+
grunt.initConfig({
18+
jshint: {
19+
all: [
20+
'Gruntfile.js',
21+
'js/compile.js',
22+
'js/demo.js',
23+
'js/runtime.js',
24+
'js/tmpl.js',
25+
'test/test.js'
26+
]
27+
},
28+
simplemocha: {
29+
options: {
30+
ignoreLeaks: false,
31+
ui: 'bdd',
32+
reporter: 'spec'
33+
},
34+
all: {
35+
src: ['test/test.js']
36+
}
37+
},
38+
mocha: {
39+
all: {
40+
src: ['test/index.html'],
41+
options: {
42+
run: true,
43+
bail: true,
44+
log: true,
45+
reporter: 'Spec'
46+
},
47+
mocha: {
48+
ignoreLeaks: false
49+
}
50+
}
51+
},
52+
uglify: {
53+
production: {
54+
src: [
55+
'js/tmpl.js'
56+
],
57+
dest: 'js/tmpl.min.js'
58+
}
59+
}
60+
});
61+
62+
grunt.loadNpmTasks('grunt-contrib-jshint');
63+
grunt.loadNpmTasks('grunt-simple-mocha');
64+
grunt.loadNpmTasks('grunt-mocha');
65+
grunt.loadNpmTasks('grunt-contrib-uglify');
66+
grunt.loadNpmTasks('grunt-bump-build-git');
67+
68+
grunt.registerTask('test', ['jshint', 'simplemocha', 'mocha']);
69+
grunt.registerTask('default', ['test', 'uglify']);
70+
71+
};

Makefile

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

bower.json

Lines changed: 43 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,45 @@
11
{
2-
"name": "blueimp-tmpl",
3-
"version": "2.4.0",
4-
"title": "JavaScript Templates",
5-
"description": "< 1KB lightweight, fast & powerful JavaScript templating engine with zero dependencies. Compatible with server-side environments like node.js, module loaders like RequireJS and all web browsers.",
6-
"keywords": [
7-
"javascript",
8-
"templates",
9-
"templating"
10-
],
11-
"homepage": "https://github.com/blueimp/JavaScript-Templates",
12-
"author": {
13-
"name": "Sebastian Tschan",
14-
"url": "https://blueimp.net"
15-
},
16-
"maintainers": [
17-
{
18-
"name": "Sebastian Tschan",
19-
"url": "https://blueimp.net"
20-
}
21-
],
22-
"repository": {
23-
"type": "git",
24-
"url": "git://github.com/blueimp/JavaScript-Templates.git"
25-
},
26-
"bugs": "https://github.com/blueimp/JavaScript-Templates/issues",
27-
"licenses": [
28-
{
29-
"type": "MIT",
30-
"url": "http://www.opensource.org/licenses/MIT"
31-
}
32-
],
33-
"devDependencies": {
34-
"mocha": "1.11.0",
35-
"expect.js": "0.2.0",
36-
"uglify-js": "2.3.6"
37-
},
38-
"main": "js/tmpl.js"
2+
"name": "blueimp-tmpl",
3+
"version": "2.5.0",
4+
"title": "JavaScript Templates",
5+
"description": "< 1KB lightweight, fast & powerful JavaScript templating engine with zero dependencies. Compatible with server-side environments like node.js, module loaders like RequireJS and all web browsers.",
6+
"keywords": [
7+
"javascript",
8+
"templates",
9+
"templating"
10+
],
11+
"homepage": "https://github.com/blueimp/JavaScript-Templates",
12+
"author": {
13+
"name": "Sebastian Tschan",
14+
"url": "https://blueimp.net"
15+
},
16+
"maintainers": [
17+
{
18+
"name": "Sebastian Tschan",
19+
"url": "https://blueimp.net"
20+
}
21+
],
22+
"repository": {
23+
"type": "git",
24+
"url": "git://github.com/blueimp/JavaScript-Templates.git"
25+
},
26+
"bugs": "https://github.com/blueimp/JavaScript-Templates/issues",
27+
"licenses": [
28+
{
29+
"type": "MIT",
30+
"url": "http://www.opensource.org/licenses/MIT"
31+
}
32+
],
33+
"devDependencies": {
34+
"mocha": "1.11.0",
35+
"expect.js": "0.2.0",
36+
"uglify-js": "2.3.6"
37+
},
38+
"main": "js/tmpl.js",
39+
"ignore": [
40+
"/*.*",
41+
"css",
42+
"js/demo.js",
43+
"test"
44+
]
3945
}

js/runtime.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* JavaScript Templates Runtime 2.4.0
2+
* JavaScript Templates Runtime 2.4.1
33
* https://github.com/blueimp/JavaScript-Templates
44
*
55
* Copyright 2011, Sebastian Tschan
@@ -29,6 +29,7 @@
2929
"'" : "&#39;"
3030
};
3131
tmpl.encode = function (s) {
32+
/*jshint eqnull:true */
3233
return (s == null ? "" : "" + s).replace(
3334
tmpl.encReg,
3435
function (c) {

js/tmpl.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* JavaScript Templates 2.4.0
2+
* JavaScript Templates 2.4.1
33
* https://github.com/blueimp/JavaScript-Templates
44
*
55
* Copyright 2011, Sebastian Tschan
@@ -66,6 +66,7 @@
6666
"'" : "&#39;"
6767
};
6868
tmpl.encode = function (s) {
69+
/*jshint eqnull:true */
6970
return (s == null ? "" : "" + s).replace(
7071
tmpl.encReg,
7172
function (c) {

js/tmpl.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 47 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,49 @@
11
{
2-
"name": "blueimp-tmpl",
3-
"version": "2.4.0",
4-
"title": "JavaScript Templates",
5-
"description": "< 1KB lightweight, fast & powerful JavaScript templating engine with zero dependencies. Compatible with server-side environments like node.js, module loaders like RequireJS and all web browsers.",
6-
"keywords": [
7-
"javascript",
8-
"templates",
9-
"templating"
10-
],
11-
"homepage": "https://github.com/blueimp/JavaScript-Templates",
12-
"author": {
13-
"name": "Sebastian Tschan",
14-
"url": "https://blueimp.net"
15-
},
16-
"maintainers": [
17-
{
18-
"name": "Sebastian Tschan",
19-
"url": "https://blueimp.net"
20-
}
21-
],
22-
"repository": {
23-
"type": "git",
24-
"url": "git://github.com/blueimp/JavaScript-Templates.git"
25-
},
26-
"bugs": "https://github.com/blueimp/JavaScript-Templates/issues",
27-
"licenses": [
28-
{
29-
"type": "MIT",
30-
"url": "http://www.opensource.org/licenses/MIT"
31-
}
32-
],
33-
"devDependencies": {
34-
"mocha": "1.12.1",
35-
"expect.js": "0.2.0",
36-
"uglify-js": "2.4.0"
37-
},
38-
"scripts": {
39-
"test": "mocha --reporter spec"
40-
},
41-
"bin": {
42-
"tmpl.js": "js/compile.js"
43-
},
44-
"main": "js/tmpl.js"
2+
"name": "blueimp-tmpl",
3+
"version": "2.5.0",
4+
"title": "JavaScript Templates",
5+
"description": "< 1KB lightweight, fast & powerful JavaScript templating engine with zero dependencies. Compatible with server-side environments like node.js, module loaders like RequireJS and all web browsers.",
6+
"keywords": [
7+
"javascript",
8+
"templates",
9+
"templating"
10+
],
11+
"homepage": "https://github.com/blueimp/JavaScript-Templates",
12+
"author": {
13+
"name": "Sebastian Tschan",
14+
"url": "https://blueimp.net"
15+
},
16+
"maintainers": [
17+
{
18+
"name": "Sebastian Tschan",
19+
"url": "https://blueimp.net"
20+
}
21+
],
22+
"repository": {
23+
"type": "git",
24+
"url": "git://github.com/blueimp/JavaScript-Templates.git"
25+
},
26+
"bugs": "https://github.com/blueimp/JavaScript-Templates/issues",
27+
"licenses": [
28+
{
29+
"type": "MIT",
30+
"url": "http://www.opensource.org/licenses/MIT"
31+
}
32+
],
33+
"devDependencies": {
34+
"grunt": "~0.4.1",
35+
"grunt-contrib-uglify": "~0.2.7",
36+
"grunt-contrib-jshint": "~0.7.1",
37+
"grunt-bump-build-git": "~1.0.0",
38+
"grunt-simple-mocha": "~0.4.0",
39+
"grunt-mocha": "~0.4.1",
40+
"expect.js": "0.2.0"
41+
},
42+
"scripts": {
43+
"test": "grunt test"
44+
},
45+
"bin": {
46+
"tmpl.js": "js/compile.js"
47+
},
48+
"main": "js/tmpl.js"
4549
}

0 commit comments

Comments
 (0)