mirror of
https://github.com/prymitive/karma
synced 2026-05-09 03:36:44 +00:00
feat(tests): add canvas mocks, needed for favico.js
This commit is contained in:
6
ui/package-lock.json
generated
6
ui/package-lock.json
generated
@@ -6506,6 +6506,12 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"jest-canvas-mock": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/jest-canvas-mock/-/jest-canvas-mock-1.1.0.tgz",
|
||||
"integrity": "sha512-D2VoKl+L6r9VpqTPygXKvIOQ1aou7gz3PvstlWDZqPT7EVYcSz0Nj+yjJ9G+Y9EqJd2X95f3dzcmmXb2dvQ1DQ==",
|
||||
"dev": true
|
||||
},
|
||||
"jest-changed-files": {
|
||||
"version": "20.0.3",
|
||||
"resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-20.0.3.tgz",
|
||||
|
||||
@@ -55,6 +55,7 @@
|
||||
"enzyme-adapter-react-16": "1.3.0",
|
||||
"enzyme-to-json": "3.3.4",
|
||||
"eslint-plugin-react": "7.11.1",
|
||||
"jest-canvas-mock": "1.1.0",
|
||||
"jest-fetch-mock": "1.6.5",
|
||||
"jest-localstorage-mock": "2.2.0",
|
||||
"jest-mock-console": "0.4.0",
|
||||
|
||||
@@ -12,6 +12,9 @@ mockConsole(["error", "warn", "info", "log", "trace"]);
|
||||
// localStorage is used for Settings store
|
||||
require("jest-localstorage-mock");
|
||||
|
||||
// favico.js needs canvas
|
||||
require("jest-canvas-mock");
|
||||
|
||||
// fetch is used in multiple places to interact with Go backend
|
||||
// or upstream Alertmanager API
|
||||
global.fetch = require("jest-fetch-mock");
|
||||
|
||||
Reference in New Issue
Block a user