mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 09:46:22 +00:00
Add setup files and localstorage mock
This commit is contained in:
@@ -163,6 +163,10 @@
|
||||
"moduleNameMapper": {
|
||||
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/__mocks__/fileMock.js",
|
||||
"\\.(css|less|styl)$": "identity-obj-proxy"
|
||||
}
|
||||
},
|
||||
"setupFiles": [
|
||||
"<rootDir>/tests/jest.js",
|
||||
"jest-localstorage-mock"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
12
tests/jest.js
Normal file
12
tests/jest.js
Normal file
@@ -0,0 +1,12 @@
|
||||
// Here you can mock the libraries connected through direct insertion <script src="" >
|
||||
global.Raphael = {
|
||||
setWindow: jest.fn(),
|
||||
registerFont: jest.fn(),
|
||||
fn: function () {
|
||||
return {}
|
||||
}
|
||||
}
|
||||
|
||||
global._ = {
|
||||
extend: jest.genMockFunction()
|
||||
}
|
||||
@@ -4997,6 +4997,10 @@ jest-leak-detector@^22.4.3:
|
||||
dependencies:
|
||||
pretty-format "^22.4.3"
|
||||
|
||||
jest-localstorage-mock@^2.2.0:
|
||||
version "2.2.0"
|
||||
resolved "https://registry.yarnpkg.com/jest-localstorage-mock/-/jest-localstorage-mock-2.2.0.tgz#ce9a9de01dfdde2ad8aa08adf73acc7e5cc394cf"
|
||||
|
||||
jest-matcher-utils@^22.4.3:
|
||||
version "22.4.3"
|
||||
resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-22.4.3.tgz#4632fe428ebc73ebc194d3c7b65d37b161f710ff"
|
||||
|
||||
Reference in New Issue
Block a user