You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guide/testingAndDebugging.md
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -79,3 +79,14 @@ testWithSpectron(
79
79
:::warning
80
80
Make sure to update spectron along with electron. See the [spectron version map](https://github.com/electron-userland/spectron#version-map) to determine what version of spectron you should be using.
81
81
:::
82
+
83
+
### Regular Unit Tests Using Electron's Version of Node
84
+
85
+
If you have a native dependency (like better-sqlite3) you might have problems running `jest` and get native dependency node version conflict errors.
86
+
87
+
To resolve this, run your Jest tests in the same version of node that electron uses. It's a bit hacky, but this works well:
You can set this as `test:unit` in your package.json to use this by default instead of the default command. This is used by [Beekeeper Studio](https://github.com/beekeeper-studio/beekeeper-studio).
0 commit comments