Skip to content

Instantly share code, notes, and snippets.

@miketaylr
Last active March 27, 2018 21:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miketaylr/8827e0b916ade6883adf71a9a7ec2c2b to your computer and use it in GitHub Desktop.
Save miketaylr/8827e0b916ade6883adf71a9a7ec2c2b to your computer and use it in GitHub Desktop.
mitaylor at omg-5 in ~/dev/webcompat-metrics on issues/28
🐓 npm run test
> webcompat-metrics@1.0.0 test /Users/mitaylor/dev/webcompat-metrics
> npm run lint && npm run test:jest
> webcompat-metrics@1.0.0 lint /Users/mitaylor/dev/webcompat-metrics
> npm run lint:JS && npm run lint:CSS
> webcompat-metrics@1.0.0 lint:JS /Users/mitaylor/dev/webcompat-metrics
> eslint ./client/src ./routes
> webcompat-metrics@1.0.0 lint:CSS /Users/mitaylor/dev/webcompat-metrics
> stylelint './client/src/**/*.css'
> webcompat-metrics@1.0.0 test:jest /Users/mitaylor/dev/webcompat-metrics
> cd client; NODE_ENV=test ./node_modules/.bin/jest --runInBand --coverage
FAIL src/containers/Navigation/__tests__/Navigation-test.js
✓ renders NavigationContainer default correctly (27ms)
✕ renders NavigationContainer matchMedia return false (13ms)
✕ NavigationContainer click button (4ms)
● renders NavigationContainer matchMedia return false
expect(value).toMatchSnapshot()
Received value does not match stored snapshot 1.
- Snapshot
+ Received
@@ -55,11 +55,11 @@
</div>
</a>
</div>
</div>,
<div
- className="component "
+ className="component isOpen"
>
<div
className="container"
>
<nav
40 | )
41 | .toJSON();
> 42 | expect(tree).toMatchSnapshot();
43 | });
44 |
45 | it("NavigationContainer click button", () => {
at Object.<anonymous> (src/containers/Navigation/__tests__/Navigation-test.js:42:16)
● NavigationContainer click button
expect(received).toBeFalsy()
Expected value to be falsy, instead received
true
45 | it("NavigationContainer click button", () => {
46 | const wrapper = shallow(<NavigationContainer />);
> 47 | expect(wrapper.state("isOpen")).toBeFalsy();
48 | wrapper.find(Header).simulate("click");
49 | expect(wrapper.state("isOpen")).toBeTruthy();
50 | });
at Object.<anonymous> (src/containers/Navigation/__tests__/Navigation-test.js:47:35)
› 1 snapshot test failed.
FAIL src/layouts/__tests__/index-test.js
✓ renders Component default correctly (11ms)
✕ renders Component matchMedia return false (10ms)
● renders Component matchMedia return false
expect(value).toMatchSnapshot()
Received value does not match stored snapshot 1.
- Snapshot
+ Received
@@ -57,11 +57,11 @@
</div>
</a>
</div>
</div>
<div
- className="component "
+ className="component isOpen"
>
<div
className="container"
>
<nav
25 | });
26 | const tree = renderer.create(<Component />).toJSON();
> 27 | expect(tree).toMatchSnapshot();
28 | });
29 |
at Object.<anonymous> (src/layouts/__tests__/index-test.js:27:16)
› 1 snapshot test failed.
PASS src/components/Header/__tests__/Header-test.js
✓ renders Header default correctly (4ms)
✓ Header click button (5ms)
PASS src/components/Menu/Link/__tests__/Link-test.js
✓ renders Link default correctly (3ms)
✓ renders Link with text and icon correctly (1ms)
✓ renders Link with node text / icon correctly (2ms)
PASS src/components/Ui/PinningMenu/__tests__/PinningMenu-test.js
✓ renders PinningMenu default correctly (3ms)
✓ renders PinningMenu mneu not opened correctly (2ms)
PASS src/components/Svg/__tests__/Svg-test.js
✓ renders Svg default correctly (2ms)
PASS src/components/Ui/PinningHeader/__tests__/PinningHeader-test.js
✓ renders PinningHeader default correctly (2ms)
PASS src/components/Ui/MainView/__tests__/Main-test.js
✓ renders MainView default correctly (2ms)
PASS src/components/Ui/Viewport/__tests__/Viewport-test.js
✓ renders Viewport default correctly (2ms)
PASS src/components/Ui/PinningMenu/__tests__/Footer-test.js
✓ renders Footer default correctly (3ms)
PASS src/components/Ui/PinningMenu/__tests__/Links-test.js
✓ renders Links default correctly (2ms)
---------------------------------|----------|----------|----------|----------|-------------------|
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s |
---------------------------------|----------|----------|----------|----------|-------------------|
All files | 86.79 | 87.5 | 80.95 | 86.79 | |
scripts | 100 | 100 | 100 | 100 | |
test-setup.js | 100 | 100 | 100 | 100 | |
src/components/Header | 100 | 100 | 100 | 100 | |
index.js | 100 | 100 | 100 | 100 | |
src/components/HomePage | 50 | 100 | 0 | 50 | |
index.js | 50 | 100 | 0 | 50 | 8 |
src/components/Menu | 0 | 0 | 0 | 0 | |
index.js | 0 | 0 | 0 | 0 | |
src/components/Menu/Link | 100 | 100 | 100 | 100 | |
index.js | 100 | 100 | 100 | 100 | |
src/components/Svg | 100 | 100 | 100 | 100 | |
index.js | 100 | 100 | 100 | 100 | |
src/components/Ui | 0 | 0 | 0 | 0 | |
index.js | 0 | 0 | 0 | 0 | |
src/components/Ui/MainView | 100 | 100 | 100 | 100 | |
index.js | 100 | 100 | 100 | 100 | |
src/components/Ui/PinningHeader | 100 | 100 | 100 | 100 | |
index.js | 100 | 100 | 100 | 100 | |
src/components/Ui/PinningMenu | 100 | 100 | 100 | 100 | |
Footer.js | 100 | 100 | 100 | 100 | |
Links.js | 100 | 100 | 100 | 100 | |
index.js | 100 | 100 | 100 | 100 | |
src/components/Ui/Viewport | 100 | 100 | 100 | 100 | |
index.js | 100 | 100 | 100 | 100 | |
src/containers/Navigation | 76.92 | 50 | 80 | 76.92 | |
index.js | 76.92 | 50 | 80 | 76.92 | 29,30,38 |
src/containers/NeedsDiagnosis | 0 | 100 | 0 | 0 | |
index.js | 0 | 100 | 0 | 0 | 9,10,14 |
src/layouts | 100 | 100 | 100 | 100 | |
index.js | 100 | 100 | 100 | 100 | |
---------------------------------|----------|----------|----------|----------|-------------------|
Snapshot Summary
› 2 snapshot tests failed in 2 test suites. Inspect your code changes or run `npm run test:jest -- -u` to update them.
Test Suites: 2 failed, 9 passed, 11 total
Tests: 3 failed, 15 passed, 18 total
Snapshots: 2 failed, 14 passed, 16 total
Time: 5.738s
Ran all test suites.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment