Bundle sql worker with webpack
This commit is contained in:
parent
31a777a130
commit
1ca121aef5
9 changed files with 177 additions and 110 deletions
31
preload.js
31
preload.js
|
@ -688,36 +688,7 @@ try {
|
|||
});
|
||||
|
||||
if (config.environment === 'test') {
|
||||
// This is a hack to let us run TypeScript tests in the renderer process. See the
|
||||
// code in `test/index.html`.
|
||||
const pendingDescribeCalls = [];
|
||||
window.describe = (...args) => {
|
||||
pendingDescribeCalls.push(args);
|
||||
};
|
||||
|
||||
/* eslint-disable global-require, import/no-extraneous-dependencies */
|
||||
const fastGlob = require('fast-glob');
|
||||
|
||||
fastGlob
|
||||
.sync('./ts/test-{both,electron}/**/*_test.js', {
|
||||
absolute: true,
|
||||
cwd: __dirname,
|
||||
})
|
||||
.forEach(require);
|
||||
|
||||
delete window.describe;
|
||||
|
||||
window.test = {
|
||||
pendingDescribeCalls,
|
||||
fastGlob,
|
||||
normalizePath: require('normalize-path'),
|
||||
fse: require('fs-extra'),
|
||||
tmp: require('tmp'),
|
||||
path: require('path'),
|
||||
basePath: __dirname,
|
||||
attachmentsPath: window.Signal.Migrations.attachmentsPath,
|
||||
};
|
||||
/* eslint-enable global-require, import/no-extraneous-dependencies */
|
||||
require('./preload_test.js');
|
||||
}
|
||||
} catch (error) {
|
||||
/* eslint-disable no-console */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue