Skip to content

Commit ca2597e

Browse files
committed
Added documentation on how to run the Unit Tests.
Remvoed the unnecessary jQuery dependency from the test HTML page.
1 parent 6d42b99 commit ca2597e

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,5 +337,14 @@ tmpl.js templates/upload.html templates/download.html > tmpl.min.js
337337
The files given as command line arguments to **tmpl.js** can either be pure template files or HTML documents with embedded template script sections. For the pure template files, the file names (without extension) serve as template ids.
338338
The generated file can be included in your project as a replacement for the original **tmpl.js** runtime. It provides you with the same API and provides a **tmpl(id, data)** function that accepts the id of one of your templates as first and a data object as optional second parameter.
339339

340+
## Tests
341+
The JavaScript Templates project comes with [Unit Tests](http://en.wikipedia.org/wiki/Unit_testing).
342+
There are two different ways to run the tests:
343+
344+
* Open test/index.html in your browser or
345+
* run `npm test` in the Terminal in the root path of the repository package.
346+
347+
The first one tests the browser integration, the second one the [node.js](http://nodejs.org/) integration.
348+
340349
## License
341350
The JavaScript Templates script is released under the [MIT license](http://www.opensource.org/licenses/MIT).

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "blueimp-tmpl",
3-
"version": "2.2.1",
3+
"version": "2.2.2",
44
"title": "JavaScript Templates",
55
"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.",
66
"keywords": [

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "blueimp-tmpl",
3-
"version": "2.2.1",
3+
"version": "2.2.2",
44
"title": "JavaScript Templates",
55
"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.",
66
"keywords": [

test/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@
2323
</head>
2424
<body>
2525
<div id="mocha"></div>
26-
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
2726
<script src="http://blueimp.github.io/cdn/js/mocha.min.js"></script>
2827
<script src="http://blueimp.github.io/cdn/js/expect.min.js"></script>
2928
<script>
3029
mocha.setup('bdd');
31-
$(function () {
32-
mocha.run();
33-
});
3430
</script>
3531
<script type="text/x-tmpl" id="template">{%=o.value%}</script>
3632
<script src="../js/tmpl.js"></script>
3733
<script src="test.js"></script>
34+
<script>
35+
mocha.checkLeaks();
36+
mocha.run();
37+
</script>
3838
</body>
3939
</html>

0 commit comments

Comments
 (0)