Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jest-cli

Package Overview
Dependencies
Maintainers
1
Versions
391
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-cli - npm Package Compare versions

Comparing version 0.0.4-pre to 0.0.5-pre

2

package.json
{
"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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc