nathanbuchar / electron-settings

📝 A simple persistent user settings framework for Electron.
https://electron-settings.js.org
MIT License
817 stars 60 forks source link

import fails in unit-test environment #106

Closed utillity closed 6 years ago

utillity commented 6 years ago

● Test suite failed to run TypeError: Cannot read property 'app' of undefined 1 | import * as Settings from 'electron-settings'; at Object.<anonymous> (node_modules/electron-settings/lib/settings.js:26:44) at Object.<anonymous> (node_modules/electron-settings/index.js:10:18) at Object.<anonymous> (src/common/ProfileService.ts:3:18)

this module should not crash on import, but on first call to a method, to enable code to be unit-tested outside electron environment!

nathanbuchar commented 6 years ago

I assume this is a duplicate of #94? Will happily accept a PR :)