aboutsummaryrefslogtreecommitdiffstats
path: root/packages/main/src/infrastructure/resources/impl/__tests__
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2022-01-27 23:48:07 +0100
committerLibravatar Kristóf Marussy <kristof@marussy.com>2022-02-08 21:43:18 +0100
commit785826a05e99c98aae872b909a833a691e4ae9fa (patch)
treed3c0099516852f312973967c621ac82f4d6b1d41 /packages/main/src/infrastructure/resources/impl/__tests__
parentbuild: Add test-utils package (diff)
downloadsophie-785826a05e99c98aae872b909a833a691e4ae9fa.tar.gz
sophie-785826a05e99c98aae872b909a833a691e4ae9fa.tar.zst
sophie-785826a05e99c98aae872b909a833a691e4ae9fa.zip
test: Add tests for main window hardening
We try to stub/mock the Electron API to make sure the test environment is as close to the runtime environment for this security critical code. Signed-off-by: Kristóf Marussy <kristof@marussy.com>
Diffstat (limited to 'packages/main/src/infrastructure/resources/impl/__tests__')
-rw-r--r--packages/main/src/infrastructure/resources/impl/__tests__/getDistResources.spec.ts20
1 files changed, 10 insertions, 10 deletions
diff --git a/packages/main/src/infrastructure/resources/impl/__tests__/getDistResources.spec.ts b/packages/main/src/infrastructure/resources/impl/__tests__/getDistResources.spec.ts
index e7e9d71..635a6b4 100644
--- a/packages/main/src/infrastructure/resources/impl/__tests__/getDistResources.spec.ts
+++ b/packages/main/src/infrastructure/resources/impl/__tests__/getDistResources.spec.ts
@@ -36,18 +36,18 @@ const [
36] = 36] =
37 os.platform() === 'win32' 37 os.platform() === 'win32'
38 ? [ 38 ? [
39 'C:\\Program Files\\sophie\\resources\\app.asar\\main\\dist', 39 'C:\\Program Files\\sophie\\resources\\app.asar\\packages\\main\\dist',
40 'C:\\Program Files\\sophie\\resources\\app.asar\\preload\\dist\\index.cjs', 40 'C:\\Program Files\\sophie\\resources\\app.asar\\packages\\preload\\dist\\index.cjs',
41 'file:///C:/Program Files/sophie/resources/app.asar/preload/dist/index.cjs', 41 'file:///C:/Program Files/sophie/resources/app.asar/packages/preload/dist/index.cjs',
42 'file:///C:/Program Files/sophie/resources/app.asar/renderer/dist/index.html', 42 'file:///C:/Program Files/sophie/resources/app.asar/packages/renderer/dist/index.html',
43 'file:///C:/Program Files/sophie/resources/app.asar/renderer/dist/', 43 'file:///C:/Program Files/sophie/resources/app.asar/packages/renderer/dist/',
44 ] 44 ]
45 : [ 45 : [
46 '/opt/sophie/resources/app.asar/main/dist', 46 '/opt/sophie/resources/app.asar/packages/main/dist',
47 '/opt/sophie/resources/app.asar/preload/dist/index.cjs', 47 '/opt/sophie/resources/app.asar/packages/preload/dist/index.cjs',
48 'file:///opt/sophie/resources/app.asar/preload/dist/index.cjs', 48 'file:///opt/sophie/resources/app.asar/packages/preload/dist/index.cjs',
49 'file:///opt/sophie/resources/app.asar/renderer/dist/index.html', 49 'file:///opt/sophie/resources/app.asar/packages/renderer/dist/index.html',
50 'file:///opt/sophie/resources/app.asar/renderer/dist/', 50 'file:///opt/sophie/resources/app.asar/packages/renderer/dist/',
51 ]; 51 ];
52 52
53const fileURLs: [string, string] = [rendererIndexFileURL, rendererRootFileURL]; 53const fileURLs: [string, string] = [rendererIndexFileURL, rendererRootFileURL];