set canvas mock

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
This commit is contained in:
Augustin Husson 2021-09-07 16:34:12 +02:00
parent 5498ca5214
commit c3306e6366
3 changed files with 257 additions and 821 deletions

File diff suppressed because it is too large Load diff

View file

@ -68,23 +68,21 @@
"@types/flot": "0.0.31",
"@types/jest": "^27.0.1",
"@types/jquery": "^3.5.1",
"@types/moment-timezone": "^0.5.10",
"@types/node": "^16.7.6",
"@types/react": "^17.0.19",
"@types/react-copy-to-clipboard": "^5.0.1",
"@types/react-dom": "^17.0.9",
"@types/react-resize-detector": "^5.0.0",
"@types/react-router-dom": "^5.1.8",
"@types/reactstrap": "^8.7.2",
"@types/sanitize-html": "^1.20.2",
"@types/sinon": "^10.0.2",
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.3",
"canvas": "^2.8.0",
"enzyme": "^3.11.0",
"enzyme-to-json": "^3.6.2",
"eslint-config-prettier": "^8.3.0",
"eslint-config-react-app": "^6.0.0",
"eslint-plugin-prettier": "^4.0.0",
"jest-canvas-mock": "^2.3.1",
"jest-fetch-mock": "^3.0.3",
"mutationobserver-shim": "^0.3.7",
"prettier": "^2.3.2",

View file

@ -3,6 +3,7 @@ import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
import { GlobalWithFetchMock } from 'jest-fetch-mock';
import 'mutationobserver-shim'; // Needed for CodeMirror.
import './globals';
import 'jest-canvas-mock';
configure({ adapter: new Adapter() });
const customGlobal: GlobalWithFetchMock = global as GlobalWithFetchMock;