Bläddra i källkod

Merge pull request #413 from phillipj/cleanup/readme-tests

Cleanup tests section in readme
tags/v1.1.0
David da Silva Contín 11 år sedan
förälder
incheckning
99b40a76c8
2 ändrade filer med 10 tillägg och 7 borttagningar
  1. +8
    -6
      README.md
  2. +2
    -1
      package.json

+ 8
- 6
README.md Visa fil

@@ -16,7 +16,7 @@ You can use mustache.js to render mustache templates anywhere you can use JavaSc


mustache.js ships with support for both the [CommonJS](http://www.commonjs.org/) module API and the [Asynchronous Module Definition](https://github.com/amdjs/amdjs-api/wiki/AMD) API, or AMD. mustache.js ships with support for both the [CommonJS](http://www.commonjs.org/) module API and the [Asynchronous Module Definition](https://github.com/amdjs/amdjs-api/wiki/AMD) API, or AMD.


And this will be your templates after you use Mustache:
And this will be your templates after you use Mustache:


!['stache](http://d24w6bsrhbeh9d.cloudfront.net/photo/aZPNGon_460sa.gif) !['stache](http://d24w6bsrhbeh9d.cloudfront.net/photo/aZPNGon_460sa.gif)


@@ -461,18 +461,20 @@ These may be built using [Rake](http://rake.rubyforge.org/) and one of the follo


## Testing ## Testing


The mustache.js test suite uses the [mocha](http://visionmedia.github.com/mocha/) testing framework. In order to run the tests you'll need to install [node](http://nodejs.org/). Once that's done you can install mocha using [npm](http://npmjs.org/).

$ npm install -g mocha
In order to run the tests you'll need to install [node](http://nodejs.org/).


You also need to install the sub module containing [Mustache specifications](http://github.com/mustache/spec) in the project root. You also need to install the sub module containing [Mustache specifications](http://github.com/mustache/spec) in the project root.


$ git submodule init $ git submodule init
$ git submodule update $ git submodule update


Install dependencies.

$ npm install

Then run the tests. Then run the tests.


$ mocha test
$ npm test


The test suite consists of both unit and integration tests. If a template isn't rendering correctly for you, you can make a test for it by doing the following: The test suite consists of both unit and integration tests. If a template isn't rendering correctly for you, you can make a test for it by doing the following:


@@ -486,7 +488,7 @@ The test suite consists of both unit and integration tests. If a template isn't


Then, you can run the test with: Then, you can run the test with:


$ TEST=mytest mocha test/render-test.js
$ TEST=mytest npm run test-render


## Thanks ## Thanks




+ 2
- 1
package.json Visa fil

@@ -18,7 +18,8 @@
"url": "https://raw.github.com/janl/mustache.js/{version}/mustache.js" "url": "https://raw.github.com/janl/mustache.js/{version}/mustache.js"
}, },
"scripts": { "scripts": {
"test": "mocha --reporter spec test"
"test": "mocha --reporter spec",
"test-render": "mocha --reporter spec test/render-test"
}, },
"devDependencies": { "devDependencies": {
"mocha": "2.0.1" "mocha": "2.0.1"


Laddar…
Avbryt
Spara