Comparing version 0.0.4-pre to 0.0.5-pre
{ | ||
"name": "jest-cli", | ||
"version": "0.0.4-pre", | ||
"version": "0.0.5-pre", | ||
"dependencies": { | ||
@@ -5,0 +5,0 @@ "coffee-script": "1.7.1", |
@@ -11,51 +11,16 @@ # [Jest](http://facebook.github.io/jest/) | ||
Take a look at the [website for more information](http://facebook.github.io/react/) | ||
Take a look at the [website for more information](http://facebook.github.io/jest/) | ||
## Getting Started | ||
<generated_getting_started_start /> | ||
Getting started with Jest is pretty simple. If you want to test the following `sum.js` file, | ||
Getting started with Jest is pretty simple. All you need to do is: | ||
```javascript | ||
// sum.js | ||
function sum(value1, value2) { | ||
return value1 + value2; | ||
} | ||
module.exports = sum; | ||
``` | ||
1 - Create a directory `__tests__/` with a file `sum-test.js` | ||
```javascript | ||
// __tests__/sum-test.js | ||
jest.dontMock('../sum'); | ||
describe('sum', function() { | ||
it('adds 1 + 2 to equal 3', function() { | ||
var sum = require('../sum'); | ||
expect(sum(1, 2)).toBe(3); | ||
}); | ||
}); | ||
``` | ||
1 - [Write some (jasmine) tests](http://facebook.github.io/jest/docs/getting-started.html) in a `__tests__/` directory | ||
2 - Run `npm install jest-cli --save-dev` | ||
3 - Add `"scripts": {"test": "jest"}` to your `package.json` | ||
4 - Run `npm test` | ||
3 - Add the following to your `package.json` | ||
This will run your automatically mocked tests for you and you'll be on your way! | ||
```js | ||
{ | ||
... | ||
"scripts": { | ||
"test": "jest" | ||
} | ||
... | ||
} | ||
``` | ||
Check out the [Getting Started](http://facebook.github.io/jest/docs/getting-started.html) tutorial for more in-depth details. | ||
4 - Run `npm test` | ||
``` | ||
[PASS] __tests__/sum-test.js (0.015s) | ||
``` | ||
<generated_getting_started_end /> | ||
## API | ||
@@ -62,0 +27,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1007449
101