-
-
Notifications
You must be signed in to change notification settings - Fork 76
Expand file tree
/
Copy pathjest.setup.js
More file actions
21 lines (19 loc) · 691 Bytes
/
Copy pathjest.setup.js
File metadata and controls
21 lines (19 loc) · 691 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
const fs = require('fs');
const rmSync = 'rmSync' in fs ? 'rmSync' : 'rmdirSync';
// eslint-disable-next-line import/no-extraneous-dependencies
const CertificateManager = require('@ulixee/unblocked-agent-mitm-socket/lib/CertificateGenerator').default;
module.exports = async () => {
try {
fs[rmSync](`${__dirname}/.data-test`, { recursive: true });
fs[rmSync](`${__dirname}/.ulixee`, { recursive: true });
fs.mkdirSync(`${__dirname}/.data-test`);
// generate certs
const certManager = new CertificateManager({
storageDir: `${__dirname}/.data-test`,
});
await certManager.waitForConnected;
certManager.close();
} catch (err) {
// ignore
}
};