Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Eliminate yarn test spam #1024

Merged
merged 13 commits into from
Apr 3, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
leverage jest-canvas-mock to avoid warnings from the doughnut chart
  • Loading branch information
lieut-data committed Mar 28, 2018
commit dc6d2a4573e9c6a4fee0584650b23edbf0a89928
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
"image-webpack-loader": "3.6.0",
"imports-loader": "0.7.1",
"jest": "22.1.4",
"jest-canvas-mock": "1.0.2",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So that the doughtnut chart doesn't throw errors about getContext not being defined.

"jest-cli": "22.1.4",
"jquery-deferred": "0.3.1",
"json-loader": "0.5.7",
Expand Down Expand Up @@ -141,6 +142,7 @@
"transformIgnorePatterns": [
"node_modules/(?!react-native|react-router)"
],
"setupFiles": ["jest-canvas-mock"],
"setupTestFrameworkScriptFile": "<rootDir>/tests/setup.js",
"testURL": "http:https://localhost:8065"
},
Expand Down
4 changes: 2 additions & 2 deletions tests/components/analytics/doughnut_chart.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('components/analytics/doughnut_chart.jsx', () => {
/>
);

expect(Chart).toBeCalledWith(null, {data, options: {}, type: 'doughnut'});
expect(Chart).toBeCalledWith(expect.anything(), {data, options: {}, type: 'doughnut'});
expect(wrapper).toMatchSnapshot();
});

Expand All @@ -51,7 +51,7 @@ describe('components/analytics/doughnut_chart.jsx', () => {
data={data}
/>
);
expect(Chart).toBeCalledWith(null, {data, options: {}, type: 'doughnut'});
expect(Chart).toBeCalledWith(expect.anything(), {data, options: {}, type: 'doughnut'});
expect(wrapper).toMatchSnapshot();
});

Expand Down
4 changes: 4 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4978,6 +4978,10 @@ [email protected]:
version "3.1.3"
resolved "https://registry.yarnpkg.com/jasny-bootstrap/-/jasny-bootstrap-3.1.3.tgz#b072a681d50c649762c9543c7a6093d9baa2f87b"

[email protected]:
version "1.0.2"
resolved "https://registry.yarnpkg.com/jest-canvas-mock/-/jest-canvas-mock-1.0.2.tgz#05373f8f87fa764ca25fb4c5d6d9e34954a05550"

jest-changed-files@^22.1.4:
version "22.1.4"
resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-22.1.4.tgz#1f7844bcb739dec07e5899a633c0cb6d5069834e"
Expand Down