Skip to content

Commit

Permalink
Mock electron-store
Browse files Browse the repository at this point in the history
This ensures tests pass.
  • Loading branch information
matheusd committed Apr 22, 2021
1 parent e119a56 commit 5799411
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
"\\.module\\.css$": "identity-obj-proxy",
"\\.css$": "<rootDir>/test/mocks/styleMock.js",
"^grpc$": "<rootDir>/test/mocks/grpcMock.js",
"^electron$": "<rootDir>/test/mocks/electronMock.js"
"^electron$": "<rootDir>/test/mocks/electronMock.js",
"^electron-store$": "<rootDir>/test/mocks/electronStore.js"
},
"transformIgnorePatterns": [
"/node_modules/",
Expand Down
16 changes: 16 additions & 0 deletions test/mocks/electronStore.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
class MockElectronStore {
get(key) {
return this[key];
}
set(key, value) {
return (this[key] = value);
}
delete(key) {
delete this[key];
}
has(key) {
return !!this[key];
}
}

export default MockElectronStore;

0 comments on commit 5799411

Please sign in to comment.