* purely test suite on steroids * verify stuff * more fun verifies * ok ok ok I'm done * extend timeout and consolidate to constant for easier usage across tests * PR feedback :) Remove warnings by adding transform regex to `ts-jest` and `testMatch`. * cleanup * cleanup * PR feedback & converting `export function` to `export const` in `util.ts`
52 lines
1.5 KiB
TypeScript
52 lines
1.5 KiB
TypeScript
import * as fs from 'fs-extra';
|
|
import * as path from 'path';
|
|
import { appsDir, asarsDir, templateApp } from './test/util';
|
|
|
|
export default async () => {
|
|
await fs.remove(appsDir);
|
|
await fs.mkdirp(appsDir);
|
|
await templateApp('Arm64Asar.app', 'arm64', async (appPath) => {
|
|
await fs.copy(
|
|
path.resolve(asarsDir, 'app.asar'),
|
|
path.resolve(appPath, 'Contents', 'Resources', 'app.asar'),
|
|
);
|
|
});
|
|
|
|
// contains `extra-file.txt`
|
|
await templateApp('Arm64AsarExtraFile.app', 'arm64', async (appPath) => {
|
|
await fs.copy(
|
|
path.resolve(asarsDir, 'app2.asar'),
|
|
path.resolve(appPath, 'Contents', 'Resources', 'app.asar'),
|
|
);
|
|
});
|
|
|
|
await templateApp('X64Asar.app', 'x64', async (appPath) => {
|
|
await fs.copy(
|
|
path.resolve(asarsDir, 'app.asar'),
|
|
path.resolve(appPath, 'Contents', 'Resources', 'app.asar'),
|
|
);
|
|
});
|
|
|
|
await templateApp('Arm64NoAsar.app', 'arm64', async (appPath) => {
|
|
await fs.copy(
|
|
path.resolve(asarsDir, 'app'),
|
|
path.resolve(appPath, 'Contents', 'Resources', 'app'),
|
|
);
|
|
});
|
|
|
|
// contains `extra-file.txt`
|
|
await templateApp('Arm64NoAsarExtraFile.app', 'arm64', async (appPath) => {
|
|
await fs.copy(
|
|
path.resolve(asarsDir, 'app2'),
|
|
path.resolve(appPath, 'Contents', 'Resources', 'app'),
|
|
);
|
|
});
|
|
|
|
await templateApp('X64NoAsar.app', 'x64', async (appPath) => {
|
|
await fs.copy(
|
|
path.resolve(asarsDir, 'app'),
|
|
path.resolve(appPath, 'Contents', 'Resources', 'app'),
|
|
);
|
|
});
|
|
};
|