mapped grafana/app/* successfuly
This commit is contained in:
parent
77c9a19437
commit
9f7182908f
3 changed files with 5 additions and 2 deletions
|
|
@ -20,6 +20,7 @@ module.exports = {
|
|||
},
|
||||
|
||||
moduleNameMapper: {
|
||||
"grafana/app/(.*)": '<rootDir>/src/jest/grafanaMock.ts',
|
||||
"^jest$": '<rootDir>/src/jest',
|
||||
'^.+\\.(css|scss)$': '<rootDir>/src/jest/styleMock.ts',
|
||||
"^lodash-es$": "lodash",
|
||||
|
|
|
|||
1
grafana-plugin/src/jest/grafanaMock.ts
Normal file
1
grafana-plugin/src/jest/grafanaMock.ts
Normal file
|
|
@ -0,0 +1 @@
|
|||
export default {};
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
// @ts-ignore
|
||||
export default global.matchMedia =
|
||||
global.matchMedia ||
|
||||
function (query) {
|
||||
|
|
@ -5,8 +6,8 @@ export default global.matchMedia =
|
|||
matches: false,
|
||||
media: query,
|
||||
onchange: null,
|
||||
addListener: jest.fn(), // deprecated
|
||||
removeListener: jest.fn(), // deprecated
|
||||
addListener: jest.fn(),
|
||||
removeListener: jest.fn(),
|
||||
addEventListener: jest.fn(),
|
||||
removeEventListener: jest.fn(),
|
||||
dispatchEvent: jest.fn(),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue