-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestConfig.ts
More file actions
31 lines (26 loc) · 1.67 KB
/
testConfig.ts
File metadata and controls
31 lines (26 loc) · 1.67 KB
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
29
30
31
import os from "node:os";
import path from "node:path";
import { TestUtil } from "./testUtil";
const packageRoot = path.resolve(__dirname, "..", "..");
const pluginRoot = process.cwd();
const DEFAULT_TEST_RUN_DIRECTORY = path.join(os.tmpdir(), TestUtil.getPluginName(), "test-run");
const DEFAULT_UPDATES_DIRECTORY = path.join(os.tmpdir(), TestUtil.getPluginName(), "updates");
const DEFAULT_TEMPLATE_PATH = path.join(packageRoot, "test", "template");
const DEFAULT_PLUGIN_TGZ_NAME =
`${TestUtil.getPluginName().replace("@", "").replace("/", "-")}-${TestUtil.getPluginVersion()}.tgz`;
const SETUP_FLAG_NAME = "--setup";
const NPM_PLUGIN_PATH = TestUtil.getPluginName();
export const TestAppName = "TestCodePush";
export const TestNamespace = "com.testcodepush";
export const AcquisitionSDKPluginName = "code-push";
export const templatePath = process.env.TEST_TEMPLATE_PATH ?? DEFAULT_TEMPLATE_PATH;
export const thisPluginPath = process.env.PLUGIN_PATH ?? pluginRoot;
export const thisPluginInstallString = TestUtil.resolveBooleanVariables(process.env.NPM)
? `npm install ${NPM_PLUGIN_PATH}`
: `npm pack ${thisPluginPath} && npm install ${DEFAULT_PLUGIN_TGZ_NAME} && npm link`;
export const testRunDirectory = process.env.RUN_DIR ?? DEFAULT_TEST_RUN_DIRECTORY;
export const updatesDirectory = process.env.UPDATE_DIR ?? DEFAULT_UPDATES_DIRECTORY;
export const onlyRunCoreTests = TestUtil.resolveBooleanVariables(process.env.CORE);
export const shouldSetup = TestUtil.readMochaCommandLineFlag(SETUP_FLAG_NAME);
export const restartEmulators = TestUtil.resolveBooleanVariables(process.env.CLEAN);
export const isOldArchitecture = TestUtil.resolveBooleanVariables(process.env.IS_OLD_ARCHITECTURE);