Yet Another Test Runner?
Me (Ran Yitzhaki)
Oliver
@ranyitz
@ranyitz
The Front-End Tooling Survey - 2018 (JavaScript Testing)
https://ashleynolan.co.uk/blog/frontend-tooling-survey-2018-results
The Front-End Tooling Survey - 2019 (JavaScript Testing)
https://ashleynolan.co.uk/blog/frontend-tooling-survey-2019-results
State of JS - Usage by Testing Framework
https://2020.stateofjs.com/en-US/technologies/testing/
Jest
Mocha
Jasmine
Jest parallelizes test runs across workers to maximize performance
Sandboxed test files and automatic global state resets for every test so no two tests conflict with each other
TestEnvironment is sandboxed. Each test suite will trigger setup/teardown in their own TestEnvironment.
Fast interactive watch mode runs only test files related to changed files and is optimized to give signal quickly
https://github.com/facebook/jest/blob/master/packages/jest-cli/src/TestSequencer.js
https://github.com/facebook/jest/blob/master/packages/jest-test-sequencer/src/index.ts#L69-L85
Run tests related to changed files & "only failed tests" mode
No need for additional tools, a complete testing solution
// bar.js
const npmInstall = require('../npm-install');
const result = npmInstall(); // some heavy work ...
console.log(result); // true
///////////////////////////////////////////////////
// bar.spec.js
jest.mock('../npm-install');
const npmInstallMock = require('../npm-install');
npmInstallMock.mockImplementation(() => true);Running Suites In parallel
Isolation Between test files
Tuned To Give Fast Feedback
Immersive Watch Mode
Beautiful diffs
Informative error messages
Assertion Library
Mocking Library
Coverage Reports
Snapshot Testing