daniel stern - mastering react testing with jest
TRANSCRIPT
// __tests__/sum-test.jsjest.dontMock('../sum');
describe('sum', function() { it('adds 1 + 2 to equal 3', function() {
var sum = require('../sum'); expect(sum(1, 2)).toBe(3);
}); });
require
require
require
[jest.dontMock(“myModule”)]
jest.autoMockOn()
jest.autoMockOff()
jest.mock()jest.dontMock()
__mocks__
expect(value).toBe(other)
beforeEachafterEach
describe()
it()
expect assert
new
mock
toBeCalled toBeCalledWith
Github – danielstern | @danieljackstern
Daniel Stern
Building a Test-Ready React Application with ES6 and Express
Application Overview
App
isomorphismlocalization express
Non-trivial isomorphic shopping cart
application with currency localization
This slide is
with
animations
Babel processes ES6 and JSX via Gulp
Express responds to HTTP requests from the
browser by serving our application
React runs on the front and back end,
facilitating everything the user sees and
interacts with and minimizing performance
issues
Application shares numerous technologies with app from Build a
Full Stack with React and Express Pluralsight, Daniel Stern
If you have course files, you can skip this chapter by checking
out the appropriate Git Branch
Before We Begin
Demo
This bullet list is
with
animations
Constructing the App
This bullet list is
with
animations
Fully functional cart application
total and currency localization with React
Real-world dependency scenarios
Learn more. Check out “Build a Full Stack with
React and Express”
Summary