File tree Expand file tree Collapse file tree 8 files changed +24
-18
lines changed
Expand file tree Collapse file tree 8 files changed +24
-18
lines changed Original file line number Diff line number Diff line change 4242
4343## Day 6 - Simplify & automate your tests
4444
45- 1 . Put test call in package.json script
46- 2 . Refactor tests using mocha.opts
47- 3 . Add mocha watch command
48- 4 . Skipping tests
49- 5 . Isolating tests
50- 6 . Increase timeouts
51- 7 . Install husky
45+ 1 . Customising your package.json scripts
46+ 2 . Add mocha watch command
47+ 3 . Refactor tests using mocha.opts
48+ 4 . Recursive testing
49+ 5 . Skipping tests
50+ 6 . Isolating tests
51+ 7 . Install git hooks
52528 . Run tests when commit or push
5353
5454## Day 7 - JavaScript testing recap
Original file line number Diff line number Diff line change 44 "description" : " " ,
55 "main" : " index.js" ,
66 "scripts" : {
7- "test" : " echo \" Error: no test specified\" && exit 1"
7+ "precommit" : " npm test" ,
8+ "prepush" : " npm test" ,
9+ "test" : " mocha" ,
10+ "test:watch" : " mocha --watch"
811 },
912 "repository" : {
1013 "type" : " git" ,
2124 "babel-preset-env" : " ~1.6.0" ,
2225 "babel-register" : " ~6.24.1" ,
2326 "chai" : " ~4.1.1" ,
27+ "husky" : " ~0.14.3" ,
2428 "mocha" : " ~3.5.0" ,
2529 "sinon" : " ~3.2.1"
2630 },
Original file line number Diff line number Diff line change 1+ --require babel-register
2+ --recursive
3+ --require test/support
Original file line number Diff line number Diff line change 1+ import { expect } from 'chai' ;
2+ import sinon from 'sinon' ;
3+
4+ global . expect = expect ;
5+ global . sinon = sinon ;
Original file line number Diff line number Diff line change 1- import { expect } from 'chai' ;
2- import day2 from '../src/day2' ;
1+ import day2 from '../../src/day2' ;
32
43describe ( 'day2 tests' , ( ) => {
54 describe ( 'check data type' , ( ) => {
Original file line number Diff line number Diff line change 1- import { expect } from 'chai' ;
2- import day3 from '../src/day3' ;
1+ import day3 from '../../src/day3' ;
32
43describe ( 'day 3 tests' , ( ) => {
54 it ( 'should return expected value from callback' , ( done ) => {
Original file line number Diff line number Diff line change 1- import sinon from 'sinon' ;
2- import { expect } from 'chai' ;
3- import { timeout , dateDescriber } from '../src/day4' ;
1+ import { timeout , dateDescriber } from '../../src/day4' ;
42
53describe ( 'day 4 tests' , ( ) => {
64 describe ( 'timeout tests' , ( ) => {
Original file line number Diff line number Diff line change 1- import { expect } from 'chai' ;
2- import sinon from 'sinon' ;
31import request from 'request' ;
4- import day5 from '../src/day5' ;
2+ import day5 from '../../ src/day5' ;
53
64describe ( 'day5 tests' , ( ) => {
75
You can’t perform that action at this time.
0 commit comments