forked from signalapp/Signal-Desktop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
preload_test.js
28 lines (22 loc) · 699 Bytes
/
preload_test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
/* global window */
const { ipcRenderer } = require('electron');
window.assert = require('chai').assert;
// This is a hack to let us run TypeScript tests in the renderer process. See the
// code in `test/index.html`.
/* eslint-disable global-require, import/no-extraneous-dependencies */
const fastGlob = require('fast-glob');
window.test = {
onComplete(info) {
return ipcRenderer.invoke('ci:test-electron:done', info);
},
prepareTests() {
fastGlob
.sync('./ts/test-{both,electron}/**/*_test.js', {
absolute: true,
cwd: __dirname,
})
.forEach(require);
},
};