2021-10-01 21:52:36 +00:00
|
|
|
// Copyright 2021 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2021-04-14 19:43:11 +00:00
|
|
|
/* global window */
|
|
|
|
|
2021-12-09 08:06:04 +00:00
|
|
|
const { ipcRenderer } = require('electron');
|
|
|
|
|
|
|
|
window.assert = require('chai').assert;
|
|
|
|
|
2021-04-14 19:43:11 +00:00
|
|
|
// 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 = {
|
2021-12-09 08:06:04 +00:00
|
|
|
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);
|
|
|
|
},
|
2021-04-14 19:43:11 +00:00
|
|
|
};
|