Skip to content

EmanuelDF/express-jest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Express com Jest

  • npm install express-generator -g
  • express myapp
  • cd myapp
  • npm install
  • mkdir js
  • cd js

// sum.js function sum(value1, value2) { return value1 + value2; } module.exports = sum;

// test/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);
}) });

  • npm install jest-cli --save-dev

"scripts": { "test": "jest" }

  • npm test -- --watchAll

About

Express com Jest

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published