GeezerVison is showing github.com — Added documentation on how to run the Unit Tests. · 701/JavaScript-Templates@ca2597e
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: README.md +9Lines changed: 9 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -337,5 +337,14 @@ tmpl.js templates/upload.html templates/download.html > tmpl.min.js |
337 | 337 | 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. |
338 | 338 | 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. |
339 | 339 |
|
| 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 | + |
340 | 349 | ## License |
341 | 350 | The JavaScript Templates script is released under the [MIT license](http://www.opensource.org/licenses/MIT). |
Collapse file
Copy file name to clipboardExpand all lines: bower.json +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | { |
2 | 2 | "name": "blueimp-tmpl", |
3 | | - "version": "2.2.1", |
| 3 | + "version": "2.2.2", |
4 | 4 | "title": "JavaScript Templates", |
5 | 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 | 6 | "keywords": [ |
|
Collapse file
Copy file name to clipboardExpand all lines: package.json +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | { |
2 | 2 | "name": "blueimp-tmpl", |
3 | | - "version": "2.2.1", |
| 3 | + "version": "2.2.2", |
4 | 4 | "title": "JavaScript Templates", |
5 | 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 | 6 | "keywords": [ |
|
Collapse file
Copy file name to clipboardExpand all lines: test/index.html +4-4Lines changed: 4 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
23 | 23 | </head> |
24 | 24 | <body> |
25 | 25 | <div id="mocha"></div> |
26 | | -<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script> |
27 | 26 | <script src="http://blueimp.github.io/cdn/js/mocha.min.js"></script> |
28 | 27 | <script src="http://blueimp.github.io/cdn/js/expect.min.js"></script> |
29 | 28 | <script> |
30 | 29 | mocha.setup('bdd'); |
31 | | -$(function () { |
32 | | - mocha.run(); |
33 | | -}); |
34 | 30 | </script> |
35 | 31 | <script type="text/x-tmpl" id="template">{%=o.value%}</script> |
36 | 32 | <script src="../js/tmpl.js"></script> |
37 | 33 | <script src="test.js"></script> |
| 34 | +<script> |
| 35 | +mocha.checkLeaks(); |
| 36 | +mocha.run(); |
| 37 | +</script> |
38 | 38 | </body> |
39 | 39 | </html> |