@itwin/certa 5.0.0-dev.8 → 5.0.0-dev.82

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,51 @@
1
1
  # Change Log - @itwin/certa
2
2
 
3
- This log was last generated on Thu, 14 Nov 2024 18:13:56 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 11 Mar 2025 15:27:53 GMT and should not be manually modified.
4
+
5
+ ## 4.10.10
6
+ Tue, 11 Mar 2025 15:25:11 GMT
7
+
8
+ _Version update only_
9
+
10
+ ## 4.10.9
11
+ Tue, 11 Mar 2025 05:17:33 GMT
12
+
13
+ _Version update only_
14
+
15
+ ## 4.10.8
16
+ Thu, 06 Mar 2025 14:13:37 GMT
17
+
18
+ _Version update only_
19
+
20
+ ## 4.10.7
21
+ Tue, 18 Feb 2025 17:27:03 GMT
22
+
23
+ _Version update only_
24
+
25
+ ## 4.10.6
26
+ Fri, 24 Jan 2025 08:02:40 GMT
27
+
28
+ _Version update only_
29
+
30
+ ## 4.10.5
31
+ Tue, 21 Jan 2025 21:56:45 GMT
32
+
33
+ _Version update only_
34
+
35
+ ## 4.10.4
36
+ Mon, 13 Jan 2025 14:06:43 GMT
37
+
38
+ _Version update only_
39
+
40
+ ## 4.10.3
41
+ Mon, 06 Jan 2025 14:00:13 GMT
42
+
43
+ _Version update only_
44
+
45
+ ## 4.10.2
46
+ Thu, 21 Nov 2024 15:22:20 GMT
47
+
48
+ _Version update only_
4
49
 
5
50
  ## 4.10.1
6
51
  Thu, 14 Nov 2024 18:11:00 GMT
package/lib/CertaCore.js CHANGED
@@ -12,6 +12,7 @@ const NodeTestRunner_1 = require("./runners/node/NodeTestRunner");
12
12
  const CoverageUtils_1 = require("./utils/CoverageUtils");
13
13
  const SpawnUtils_1 = require("./utils/SpawnUtils");
14
14
  class CertaCore {
15
+ static _runners = {};
15
16
  static registerTestRunner(environment, runner) {
16
17
  this._runners[environment] = runner;
17
18
  }
@@ -22,7 +23,6 @@ class CertaCore {
22
23
  }
23
24
  }
24
25
  exports.CertaCore = CertaCore;
25
- CertaCore._runners = {};
26
26
  CertaCore.registerTestRunner("node", NodeTestRunner_1.NodeTestRunner);
27
27
  CertaCore.registerTestRunner("chrome", ChromeTestRunner_1.ChromeTestRunner);
28
28
  CertaCore.registerTestRunner("electron", ElectronTestRunner_1.ElectronTestRunner);
@@ -1 +1 @@
1
- {"version":3,"file":"CertaCore.js","sourceRoot":"","sources":["../src/CertaCore.ts"],"names":[],"mappings":";;;AAqCA,sBA+BC;AApED;;;+FAG+F;AAC/F,8EAA2E;AAC3E,wEAAqE;AAErE,kEAA+D;AAC/D,yDAA4D;AAC5D,mDAAmD;AASnD,MAAa,SAAS;IAGb,MAAM,CAAC,kBAAkB,CAAC,WAAmB,EAAE,MAAuB;QAC3E,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,GAAG,MAAM,CAAC;IACtC,CAAC;IAEM,MAAM,CAAC,aAAa,CAAC,WAAmB;QAC7C,IAAI,WAAW,IAAI,IAAI,CAAC,QAAQ;YAC9B,OAAO,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QAEpC,MAAM,IAAI,KAAK,CAAC,wBAAwB,WAAW,GAAG,CAAC,CAAC;IAC1D,CAAC;;AAZH,8BAaC;AAZgB,kBAAQ,GAA+C,EAAE,CAAC;AAc3E,SAAS,CAAC,kBAAkB,CAAC,MAAM,EAAE,+BAAc,CAAC,CAAC;AACrD,SAAS,CAAC,kBAAkB,CAAC,QAAQ,EAAE,mCAAgB,CAAC,CAAC;AACzD,SAAS,CAAC,kBAAkB,CAAC,UAAU,EAAE,uCAAkB,CAAC,CAAC;AAEtD,KAAK,UAAU,KAAK,CAAC,WAAmB,EAAE,MAAmB;IAClE,MAAM,MAAM,GAAG,SAAS,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;IAEpD,wHAAwH;IACxH,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,KAAK,SAAS,CAAC;IACvD,IAAI,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,gBAAgB,IAAI,CAAC,YAAY;QAC1D,OAAO,OAAO,CAAC,IAAI,CAAC,MAAM,IAAA,mCAAmB,GAAE,CAAC,CAAC;IAEnD,IAAI,MAAM,CAAC,UAAU;QACnB,MAAM,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IAElC,gGAAgG;IAChG,IAAI,MAAM,CAAC,KAAK;QACd,IAAA,0BAAa,EAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAExC,gDAAgD;IAChD,OAAO,CAAC,oBAAoB,CAAC,CAAC,OAAO,EAAE,CAAC;IAExC;;;;OAIG;IACH,IAAI,eAA2D,CAAC;IAChE,IAAI,MAAM,CAAC,iBAAiB;QAC1B,eAAe,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;IAE5D,MAAM,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAE9B,IAAI,OAAO,eAAe,KAAK,UAAU,IAAI,MAAM,CAAC,eAAe;QACjE,MAAM,eAAe,EAAE,CAAC;AAC5B,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { ElectronTestRunner } from \"./runners/electron/ElectronTestRunner\";\nimport { ChromeTestRunner } from \"./runners/chrome/ChromeTestRunner\";\nimport { CertaConfig } from \"./CertaConfig\";\nimport { NodeTestRunner } from \"./runners/node/NodeTestRunner\";\nimport { relaunchForCoverage } from \"./utils/CoverageUtils\";\nimport { startDebugger } from \"./utils/SpawnUtils\";\n\nexport interface CertaTestRunner {\n readonly supportsCoverage: boolean;\n readonly supportsCleanup: boolean;\n initialize?(config: CertaConfig): Promise<void>;\n runTests(config: CertaConfig): Promise<void>;\n}\n\nexport class CertaCore {\n private static _runners: { [environment: string]: CertaTestRunner } = {};\n\n public static registerTestRunner(environment: string, runner: CertaTestRunner) {\n this._runners[environment] = runner;\n }\n\n public static getTestRunner(environment: string): CertaTestRunner {\n if (environment in this._runners)\n return this._runners[environment];\n\n throw new Error(`Unknown TestRunner: \"${environment}\"`);\n }\n}\n\nCertaCore.registerTestRunner(\"node\", NodeTestRunner);\nCertaCore.registerTestRunner(\"chrome\", ChromeTestRunner);\nCertaCore.registerTestRunner(\"electron\", ElectronTestRunner);\n\nexport async function certa(environment: string, config: CertaConfig): Promise<void> {\n const runner = CertaCore.getTestRunner(environment);\n\n // If we're going to measure code coverage, we should stop now and let an `nyc`-wrapped child process take it from here.\n const alreadyInNyc = process.env.NYC_CWD !== undefined;\n if (config.cover && runner.supportsCoverage && !alreadyInNyc)\n return process.exit(await relaunchForCoverage());\n\n if (runner.initialize)\n await runner.initialize(config);\n\n // In debug mode, we should now start listening for debugger connections (if we're not already).\n if (config.debug)\n startDebugger(config.ports.debugging);\n\n // Source map any errors in this backend process\n require(\"source-map-support\").install();\n\n /**\n * undefined if backendInitModule not specified;\n * callback if a cleanup function is returned by the backendInitModule export;\n * empty object if nothing is exported by the backendInitModule\n */\n let cleanUpCallback: undefined | (() => Promise<void>) | object;\n if (config.backendInitModule)\n cleanUpCallback = await require(config.backendInitModule);\n\n await runner.runTests(config);\n\n if (typeof cleanUpCallback === \"function\" && runner.supportsCleanup)\n await cleanUpCallback();\n}\n"]}
1
+ {"version":3,"file":"CertaCore.js","sourceRoot":"","sources":["../src/CertaCore.ts"],"names":[],"mappings":";;;AAqCA,sBA+BC;AApED;;;+FAG+F;AAC/F,8EAA2E;AAC3E,wEAAqE;AAErE,kEAA+D;AAC/D,yDAA4D;AAC5D,mDAAmD;AASnD,MAAa,SAAS;IACZ,MAAM,CAAC,QAAQ,GAA+C,EAAE,CAAC;IAElE,MAAM,CAAC,kBAAkB,CAAC,WAAmB,EAAE,MAAuB;QAC3E,IAAI,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AAiB,CAAC,CAAC;IAE5D,MAAM,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAE9B,IAAI,OAAO,eAAe,KAAK,UAAU,IAAI,MAAM,CAAC,eAAe;QACjE,MAAM,eAAe,EAAE,CAAC;AAC5B,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { ElectronTestRunner } from \"./runners/electron/ElectronTestRunner\";\nimport { ChromeTestRunner } from \"./runners/chrome/ChromeTestRunner\";\nimport { CertaConfig } from \"./CertaConfig\";\nimport { NodeTestRunner } from \"./runners/node/NodeTestRunner\";\nimport { relaunchForCoverage } from \"./utils/CoverageUtils\";\nimport { startDebugger } from \"./utils/SpawnUtils\";\n\nexport interface CertaTestRunner {\n readonly supportsCoverage: boolean;\n readonly supportsCleanup: boolean;\n initialize?(config: CertaConfig): Promise<void>;\n runTests(config: CertaConfig): Promise<void>;\n}\n\nexport class CertaCore {\n private static _runners: { [environment: string]: CertaTestRunner } = {};\n\n public static registerTestRunner(environment: string, runner: CertaTestRunner) {\n this._runners[environment] = runner;\n }\n\n public static getTestRunner(environment: string): CertaTestRunner {\n if (environment in this._runners)\n return this._runners[environment];\n\n throw new Error(`Unknown TestRunner: \"${environment}\"`);\n }\n}\n\nCertaCore.registerTestRunner(\"node\", NodeTestRunner);\nCertaCore.registerTestRunner(\"chrome\", ChromeTestRunner);\nCertaCore.registerTestRunner(\"electron\", ElectronTestRunner);\n\nexport async function certa(environment: string, config: CertaConfig): Promise<void> {\n const runner = CertaCore.getTestRunner(environment);\n\n // If we're going to measure code coverage, we should stop now and let an `nyc`-wrapped child process take it from here.\n const alreadyInNyc = process.env.NYC_CWD !== undefined;\n if (config.cover && runner.supportsCoverage && !alreadyInNyc)\n return process.exit(await relaunchForCoverage());\n\n if (runner.initialize)\n await runner.initialize(config);\n\n // In debug mode, we should now start listening for debugger connections (if we're not already).\n if (config.debug)\n startDebugger(config.ports.debugging);\n\n // Source map any errors in this backend process\n require(\"source-map-support\").install();\n\n /**\n * undefined if backendInitModule not specified;\n * callback if a cleanup function is returned by the backendInitModule export;\n * empty object if nothing is exported by the backendInitModule\n */\n let cleanUpCallback: undefined | (() => Promise<void>) | object;\n if (config.backendInitModule)\n cleanUpCallback = await require(config.backendInitModule);\n\n await runner.runTests(config);\n\n if (typeof cleanUpCallback === \"function\" && runner.supportsCleanup)\n await cleanUpCallback();\n}\n"]}
@@ -14,6 +14,8 @@ const MochaRemoteReporter_1 = require("./MochaRemoteReporter");
14
14
  let browser;
15
15
  let webserverProcess;
16
16
  class ChromeTestRunner {
17
+ static supportsCoverage = true;
18
+ static supportsCleanup = true;
17
19
  static async initialize(config) {
18
20
  // Go ahead and launch playwright now - the VS Code debugger gets confused if it can't at least see the chrome instance right away.
19
21
  const options = {
@@ -50,8 +52,6 @@ class ChromeTestRunner {
50
52
  }
51
53
  }
52
54
  exports.ChromeTestRunner = ChromeTestRunner;
53
- ChromeTestRunner.supportsCoverage = true;
54
- ChromeTestRunner.supportsCleanup = true;
55
55
  async function loadScript(page, scriptPath) {
56
56
  return page.addScriptTag({ url: `/@/${scriptPath}` });
57
57
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ChromeTestRunner.js","sourceRoot":"","sources":["../../../src/runners/chrome/ChromeTestRunner.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,6BAA6B;AAC7B,2CAAoE;AAEpE,uDAA2D;AAC3D,6DAAsE;AAEtE,6DAA8D;AAC9D,+DAAgE;AAShE,IAAI,OAAgB,CAAC;AACrB,IAAI,gBAA8B,CAAC;AAEnC,MAAa,gBAAgB;IAGpB,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,MAAmB;QAChD,mIAAmI;QACnI,MAAM,OAAO,GAAkB;YAC7B,IAAI,EAAE,MAAM,CAAC,aAAa,CAAC,IAAI;YAC/B,QAAQ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C,CAAC;YAC5F,MAAM,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,+BAA+B,CAAC,CAAC,CAAC;YACzE,MAAM,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC,CAAC;YAChE,MAAM,IAAA,6CAAuB,EAAC,IAAI,CAAC,CAAC;YACpC,MAAM,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,0BAA0B,CAAC,CAAC,CAAC;YACpE,MAAM,UAAU,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;YAEnC,yBAAyB;YACzB,MAAM,IAAI,CAAC,QAAQ,CAAC,KAAK,IAAI,EAAE;gBAC7B,uDAAuD;gBACvD,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,GAAG,IAAW,CAAC;gBACzC,MAAM,OAAO,GAAG,MAAa,CAAC;gBAC9B,KAAK,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE;oBACrB,MAAM,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC;oBACtC,OAAO,CAAC,mBAAmB,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,8BAA8B;gBACrF,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,sEAAsE;QACvF,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport * as path from \"path\";\nimport { Browser, chromium, LaunchOptions, Page } from \"playwright\";\nimport { ChildProcess } from \"child_process\";\nimport { spawnChildProcess } from \"../../utils/SpawnUtils\";\nimport { executeRegisteredCallback } from \"../../utils/CallbackUtils\";\nimport { CertaConfig } from \"../../CertaConfig\";\nimport { writeCoverageData } from \"../../utils/CoverageUtils\";\nimport { configureRemoteReporter } from \"./MochaRemoteReporter\";\n\ninterface ChromeTestResults {\n failures: number;\n coverage: any;\n}\n\ntype ConsoleMethodName = \"log\" | \"error\" | \"dir\";\n\nlet browser: Browser;\nlet webserverProcess: ChildProcess;\n\nexport class ChromeTestRunner {\n public static readonly supportsCoverage = true;\n public static readonly supportsCleanup = true;\n public static async initialize(config: CertaConfig): Promise<void> {\n // Go ahead and launch playwright now - the VS Code debugger gets confused if it can't at least see the chrome instance right away.\n const options: LaunchOptions = {\n args: config.chromeOptions.args,\n headless: !config.debug,\n };\n\n if (config.debug)\n options.args?.push(`--disable-gpu`, `--remote-debugging-port=${config.ports.frontendDebugging}`);\n\n browser = await chromium.launch(options);\n\n const webserverEnv = {\n CERTA_PORT: `${config.ports.frontend}`, // eslint-disable-line @typescript-eslint/naming-convention\n CERTA_PATH: path.join(__dirname, \"../../../public/index.html\"), // eslint-disable-line @typescript-eslint/naming-convention\n CERTA_PUBLIC_DIRS: JSON.stringify(config.chromeOptions.publicDirs), // eslint-disable-line @typescript-eslint/naming-convention\n };\n webserverProcess = spawnChildProcess(\"node\", [require.resolve(\"./webserver\")], webserverEnv, true);\n\n // Don't continue until the webserver is started and listening.\n const webserverExited = new Promise<never>((_resolve, reject) => webserverProcess.once(\"exit\", () => reject(new Error(\"Webserver exited!\"))));\n const webserverStarted = new Promise<number>((resolve) => webserverProcess.once(\"message\", resolve));\n const actualPort = await Promise.race([webserverExited, webserverStarted]);\n if (actualPort !== config.ports.frontend)\n console.warn(`CERTA: Port ${config.ports.frontend} was already in use, so serving test resources on port ${actualPort}`);\n process.env.CERTA_PORT = String(actualPort);\n }\n\n public static async runTests(config: CertaConfig): Promise<void> {\n // FIXME: Do we really want to always enforce this behavior?\n if (process.env.CI || process.env.TF_BUILD)\n (config.mochaOptions as any).forbidOnly = true;\n\n const { failures, coverage } = await runTestsInPlaywright(config, process.env.CERTA_PORT!);\n webserverProcess.kill();\n\n // Save nyc/istanbul coverage file.\n if (config.cover)\n writeCoverageData(coverage);\n\n process.exitCode = failures;\n }\n}\n\nasync function loadScript(page: Page, scriptPath: string) {\n return page.addScriptTag({ url: `/@/${scriptPath}` });\n}\n\nasync function runTestsInPlaywright(config: CertaConfig, port: string) {\n return new Promise<ChromeTestResults>(async (resolve, reject) => {\n try {\n const page = browser.contexts().pop()?.pages()?.pop() || await browser.newPage();\n\n // Don't let dialogs block tests\n page.on(\"dialog\", async (dialog: any) => dialog.dismiss());\n\n // Re-throw any uncaught exceptions from the frontend in the backend\n page.on(\"pageerror\", reject);\n\n // Expose some functions to the frontend that will execute _in the backend context_\n await page.exposeFunction(\"_CertaConsole\", (type: ConsoleMethodName, args: any[]) => console[type](...args));\n await page.exposeFunction(\"_CertaSendToBackend\", executeRegisteredCallback);\n await page.exposeFunction(\"_CertaReportResults\", (results: ChromeTestResults) => {\n setTimeout(async () => {\n await browser.close();\n resolve(results);\n });\n });\n\n // Now load the page (and requisite scripts)...\n const testBundle = (config.cover && config.instrumentedTestBundle) || config.testBundle;\n await page.goto(`http://localhost:${port}`);\n await page.addScriptTag({ content: `var _CERTA_CONFIG = ${JSON.stringify(config)};` });\n await loadScript(page, require.resolve(\"../../utils/initLogging.js\"));\n await loadScript(page, require.resolve(\"mocha/mocha.js\"));\n await loadScript(page, require.resolve(\"source-map-support/browser-source-map-support.js\"));\n await loadScript(page, require.resolve(\"../../utils/initSourceMaps.js\"));\n await loadScript(page, require.resolve(\"./MochaSerializer.js\"));\n await configureRemoteReporter(page);\n await loadScript(page, require.resolve(\"../../utils/initMocha.js\"));\n await loadScript(page, testBundle);\n\n // ...and start the tests\n await page.evaluate(async () => {\n // NB: This is being evaluated in the frontend context!\n Mocha.reporters.Base.color = true as any;\n const globals = window as any;\n mocha.run((failures) => {\n const coverage = globals.__coverage__;\n globals._CertaReportResults({ failures, coverage }); // This will close the browser\n });\n });\n } catch (error) {\n reject(error); // eslint-disable-line @typescript-eslint/prefer-promise-reject-errors\n }\n });\n}\n"]}
1
+ {"version":3,"file":"ChromeTestRunner.js","sourceRoot":"","sources":["../../../src/runners/chrome/ChromeTestRunner.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,6BAA6B;AAC7B,2CAAoE;AAEpE,uDAA2D;AAC3D,6DAAsE;AAEtE,6DAA8D;AAC9D,+DAAgE;AAShE,IAAI,OAAgB,CAAC;AACrB,IAAI,gBAA8B,CAAC;AAEnC,MAAa,gBAAgB;IACpB,MAAM,CAAU,gBAAgB,GAAG,IAAI,CAAC;IACxC,MAAM,CAAU,eAAe,GAAG,IAAI,CAAC;IACvC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,MAAmB;QAChD,mIAAmI;QACnI,MAAM,OAAO,GAAkB;YAC7B,IAAI,EAAE,MAAM,CAAC,aAAa,CAAC,IAAI;YAC/B,QAAQ,EAAE,CAAC,MAAM,CAAC,KAAK;SACxB,CAAC;QAEF,IAAI,MAAM,CAAC,KAAK;YACd,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,eAAe,EAAE,2BAA2B,MAAM,CAAC,KAAK,CAAC,iBAAiB,EAAE,CAAC,CAAC;QAEnG,OAAO,GAAG,MAAM,qBAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAEzC,MAAM,YAAY,GAAG;YACnB,UAAU,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,2DAA2D;YACnG,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,4BAA4B,CAAC,EAAE,2DAA2D;YAC3H,iBAAiB,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,aAAa,CAAC,UAAU,CAAC,EAAE,2DAA2D;SAChI,CAAC;QACF,gBAAgB,GAAG,IAAA,8BAAiB,EAAC,MAAM,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,EAAE,YAAY,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AQ,EAAE,CAAC,CAAC,CAAC,8BAA8B;gBACrF,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,sEAAsE;QACvF,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport * as path from \"path\";\nimport { Browser, chromium, LaunchOptions, Page } from \"playwright\";\nimport { ChildProcess } from \"child_process\";\nimport { spawnChildProcess } from \"../../utils/SpawnUtils\";\nimport { executeRegisteredCallback } from \"../../utils/CallbackUtils\";\nimport { CertaConfig } from \"../../CertaConfig\";\nimport { writeCoverageData } from \"../../utils/CoverageUtils\";\nimport { configureRemoteReporter } from \"./MochaRemoteReporter\";\n\ninterface ChromeTestResults {\n failures: number;\n coverage: any;\n}\n\ntype ConsoleMethodName = \"log\" | \"error\" | \"dir\";\n\nlet browser: Browser;\nlet webserverProcess: ChildProcess;\n\nexport class ChromeTestRunner {\n public static readonly supportsCoverage = true;\n public static readonly supportsCleanup = true;\n public static async initialize(config: CertaConfig): Promise<void> {\n // Go ahead and launch playwright now - the VS Code debugger gets confused if it can't at least see the chrome instance right away.\n const options: LaunchOptions = {\n args: config.chromeOptions.args,\n headless: !config.debug,\n };\n\n if (config.debug)\n options.args?.push(`--disable-gpu`, `--remote-debugging-port=${config.ports.frontendDebugging}`);\n\n browser = await chromium.launch(options);\n\n const webserverEnv = {\n CERTA_PORT: `${config.ports.frontend}`, // eslint-disable-line @typescript-eslint/naming-convention\n CERTA_PATH: path.join(__dirname, \"../../../public/index.html\"), // eslint-disable-line @typescript-eslint/naming-convention\n CERTA_PUBLIC_DIRS: JSON.stringify(config.chromeOptions.publicDirs), // eslint-disable-line @typescript-eslint/naming-convention\n };\n webserverProcess = spawnChildProcess(\"node\", [require.resolve(\"./webserver\")], webserverEnv, true);\n\n // Don't continue until the webserver is started and listening.\n const webserverExited = new Promise<never>((_resolve, reject) => webserverProcess.once(\"exit\", () => reject(new Error(\"Webserver exited!\"))));\n const webserverStarted = new Promise<number>((resolve) => webserverProcess.once(\"message\", resolve));\n const actualPort = await Promise.race([webserverExited, webserverStarted]);\n if (actualPort !== config.ports.frontend)\n console.warn(`CERTA: Port ${config.ports.frontend} was already in use, so serving test resources on port ${actualPort}`);\n process.env.CERTA_PORT = String(actualPort);\n }\n\n public static async runTests(config: CertaConfig): Promise<void> {\n // FIXME: Do we really want to always enforce this behavior?\n if (process.env.CI || process.env.TF_BUILD)\n (config.mochaOptions as any).forbidOnly = true;\n\n const { failures, coverage } = await runTestsInPlaywright(config, process.env.CERTA_PORT!);\n webserverProcess.kill();\n\n // Save nyc/istanbul coverage file.\n if (config.cover)\n writeCoverageData(coverage);\n\n process.exitCode = failures;\n }\n}\n\nasync function loadScript(page: Page, scriptPath: string) {\n return page.addScriptTag({ url: `/@/${scriptPath}` });\n}\n\nasync function runTestsInPlaywright(config: CertaConfig, port: string) {\n return new Promise<ChromeTestResults>(async (resolve, reject) => {\n try {\n const page = browser.contexts().pop()?.pages()?.pop() || await browser.newPage();\n\n // Don't let dialogs block tests\n page.on(\"dialog\", async (dialog: any) => dialog.dismiss());\n\n // Re-throw any uncaught exceptions from the frontend in the backend\n page.on(\"pageerror\", reject);\n\n // Expose some functions to the frontend that will execute _in the backend context_\n await page.exposeFunction(\"_CertaConsole\", (type: ConsoleMethodName, args: any[]) => console[type](...args));\n await page.exposeFunction(\"_CertaSendToBackend\", executeRegisteredCallback);\n await page.exposeFunction(\"_CertaReportResults\", (results: ChromeTestResults) => {\n setTimeout(async () => {\n await browser.close();\n resolve(results);\n });\n });\n\n // Now load the page (and requisite scripts)...\n const testBundle = (config.cover && config.instrumentedTestBundle) || config.testBundle;\n await page.goto(`http://localhost:${port}`);\n await page.addScriptTag({ content: `var _CERTA_CONFIG = ${JSON.stringify(config)};` });\n await loadScript(page, require.resolve(\"../../utils/initLogging.js\"));\n await loadScript(page, require.resolve(\"mocha/mocha.js\"));\n await loadScript(page, require.resolve(\"source-map-support/browser-source-map-support.js\"));\n await loadScript(page, require.resolve(\"../../utils/initSourceMaps.js\"));\n await loadScript(page, require.resolve(\"./MochaSerializer.js\"));\n await configureRemoteReporter(page);\n await loadScript(page, require.resolve(\"../../utils/initMocha.js\"));\n await loadScript(page, testBundle);\n\n // ...and start the tests\n await page.evaluate(async () => {\n // NB: This is being evaluated in the frontend context!\n Mocha.reporters.Base.color = true as any;\n const globals = window as any;\n mocha.run((failures) => {\n const coverage = globals.__coverage__;\n globals._CertaReportResults({ failures, coverage }); // This will close the browser\n });\n });\n } catch (error) {\n reject(error); // eslint-disable-line @typescript-eslint/prefer-promise-reject-errors\n }\n });\n}\n"]}
@@ -100,15 +100,15 @@ declare class MochaSerializer {
100
100
  emit(name: "require", module: any, file: string, mocha: Mocha): boolean;
101
101
  emit(name: "post-require", context: Mocha.MochaGlobals, file: string, mocha: Mocha): boolean;
102
102
  emit(name: string, ...args: any[]): boolean;
103
- off(eventName: string | symbol, listener: (...args: any[]) => void): Mocha.Suite;
104
- removeAllListeners(event?: string | symbol): Mocha.Suite;
103
+ off<K>(eventName: string | symbol, listener: (...args: any[]) => void): Mocha.Suite;
104
+ removeAllListeners(eventName?: string | symbol | undefined): Mocha.Suite;
105
105
  setMaxListeners(n: number): Mocha.Suite;
106
106
  getMaxListeners(): number;
107
- listeners(eventName: string | symbol): Function[];
108
- rawListeners(eventName: string | symbol): Function[];
109
- listenerCount(eventName: string | symbol, listener?: Function): number;
110
- eventNames(): Array<string | symbol>;
111
- [EventEmitter.captureRejectionSymbol]?(error: Error, event: string, ...args: any[]): void;
107
+ listeners<K>(eventName: string | symbol): Function[];
108
+ rawListeners<K>(eventName: string | symbol): Function[];
109
+ listenerCount<K>(eventName: string | symbol, listener?: Function | undefined): number;
110
+ eventNames(): (string | symbol)[];
111
+ [EventEmitter.captureRejectionSymbol]?<K>(error: Error, event: string | symbol, ...args: any[]): void;
112
112
  $$index: number;
113
113
  $$typeName: string;
114
114
  } | {
@@ -145,15 +145,15 @@ declare class MochaSerializer {
145
145
  prependOnceListener(event: string, listener: (...args: any[]) => void): Mocha.Test;
146
146
  emit(name: "error", error: any): boolean;
147
147
  emit(name: string, ...args: any[]): boolean;
148
- off(eventName: string | symbol, listener: (...args: any[]) => void): Mocha.Test;
149
- removeAllListeners(event?: string | symbol): Mocha.Test;
148
+ off<K>(eventName: string | symbol, listener: (...args: any[]) => void): Mocha.Test;
149
+ removeAllListeners(eventName?: string | symbol | undefined): Mocha.Test;
150
150
  setMaxListeners(n: number): Mocha.Test;
151
151
  getMaxListeners(): number;
152
- listeners(eventName: string | symbol): Function[];
153
- rawListeners(eventName: string | symbol): Function[];
154
- listenerCount(eventName: string | symbol, listener?: Function): number;
155
- eventNames(): Array<string | symbol>;
156
- [EventEmitter.captureRejectionSymbol]?(error: Error, event: string, ...args: any[]): void;
152
+ listeners<K>(eventName: string | symbol): Function[];
153
+ rawListeners<K>(eventName: string | symbol): Function[];
154
+ listenerCount<K>(eventName: string | symbol, listener?: Function | undefined): number;
155
+ eventNames(): (string | symbol)[];
156
+ [EventEmitter.captureRejectionSymbol]?<K>(error: Error, event: string | symbol, ...args: any[]): void;
157
157
  $$index: number;
158
158
  $$typeName: string;
159
159
  } | {
@@ -189,15 +189,15 @@ declare class MochaSerializer {
189
189
  prependOnceListener(event: string, listener: (...args: any[]) => void): Mocha.Hook;
190
190
  emit(name: "error", error: any): boolean;
191
191
  emit(name: string, ...args: any[]): boolean;
192
- off(eventName: string | symbol, listener: (...args: any[]) => void): Mocha.Hook;
193
- removeAllListeners(event?: string | symbol): Mocha.Hook;
192
+ off<K>(eventName: string | symbol, listener: (...args: any[]) => void): Mocha.Hook;
193
+ removeAllListeners(eventName?: string | symbol | undefined): Mocha.Hook;
194
194
  setMaxListeners(n: number): Mocha.Hook;
195
195
  getMaxListeners(): number;
196
- listeners(eventName: string | symbol): Function[];
197
- rawListeners(eventName: string | symbol): Function[];
198
- listenerCount(eventName: string | symbol, listener?: Function): number;
199
- eventNames(): Array<string | symbol>;
200
- [EventEmitter.captureRejectionSymbol]?(error: Error, event: string, ...args: any[]): void;
196
+ listeners<K>(eventName: string | symbol): Function[];
197
+ rawListeners<K>(eventName: string | symbol): Function[];
198
+ listenerCount<K>(eventName: string | symbol, listener?: Function | undefined): number;
199
+ eventNames(): (string | symbol)[];
200
+ [EventEmitter.captureRejectionSymbol]?<K>(error: Error, event: string | symbol, ...args: any[]): void;
201
201
  $$index: number;
202
202
  $$typeName: string;
203
203
  } | {
@@ -17,6 +17,7 @@
17
17
  * on the backend as we deserialize.
18
18
  */
19
19
  class MochaSerializer {
20
+ static _registry = [];
20
21
  static createHandle(raw, isPrimary) {
21
22
  let $$index = this._registry.indexOf(raw);
22
23
  // Browser side of mocha is webpacked so the constructor name has an added suffix for example `Test` is converted into `Test$4`.
@@ -81,7 +82,6 @@ class MochaSerializer {
81
82
  });
82
83
  }
83
84
  }
84
- MochaSerializer._registry = [];
85
85
  if (typeof global !== "undefined")
86
86
  global.MochaSerializer = MochaSerializer;
87
87
  //# sourceMappingURL=MochaSerializer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MochaSerializer.js","sourceRoot":"","sources":["../../../src/runners/chrome/MochaSerializer.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F,iHAAiH;AAKjH;;;;;;;;;;;GAWG;AACH,MAAM,eAAe;IAGZ,MAAM,CAAC,YAAY,CAAC,GAAa,EAAE,SAAkB;QAC1D,IAAI,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC1C,gIAAgI;QAChI,6IAA6I;QAC7I,IAAI,UAAkB,CAAC;QACvB,IAAI,GAAG,YAAY,KAAK,CAAC,KAAK;YAC5B,UAAU,GAAG,OAAO,CA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------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n// NB: This file is not a CommonJs module - it needs to run in the browser. Do not import or export modules here!\n\n// Object types we need to handle specially when serializing/deserializing\ntype MochaObj = Mocha.Runnable | Mocha.Suite;\n\n/**\n * Helper for marshalling certain mocha objects between frontend and backend processes.\n *\n * Normally, playwright automatically uses JSON to serialize and deserialize arguments to backend functions exposed via `page.exposeFunction()`.\n * However, we face two problems when trying to pass `Mocha.Runnable` and `Mocha.Suite` instances to the backend:\n * - These objects have circular references\n * - JSON round-tripping won't preserve these objects' prototypes, and thus will be missing methods that reporters rely on.\n *\n * This class attempts to solve this by replacing all instances of these classes with \"handles\" that simply refer to their\n * index in a central \"registry\" array. Because we serialize and deserialize in the same order, we can re-create this \"registry\"\n * on the backend as we deserialize.\n */\nclass MochaSerializer {\n private static _registry: MochaObj[] = [];\n\n public static createHandle(raw: MochaObj, isPrimary: boolean) {\n let $$index = this._registry.indexOf(raw);\n // Browser side of mocha is webpacked so the constructor name has an added suffix for example `Test` is converted into `Test$4`.\n // This is not the case is node side of mocha, so an error is thrown because of this mismatch. The `.replace()` is there to strip that suffix\n let $$typeName: string;\n if (raw instanceof Mocha.Suite)\n $$typeName = \"Suite\";\n else if (raw instanceof Mocha.Test)\n $$typeName = \"Test\";\n else if (raw instanceof Mocha.Hook)\n $$typeName = \"Hook\";\n else\n throw new Error(\"Unexpected instance of Mocha\");\n\n if ($$index < 0) {\n $$index = this._registry.push(raw) - 1;\n // This is a new instance, so we also need to include its properties\n isPrimary = true;\n }\n\n return (isPrimary) ? { $$index, $$typeName, ...raw } : { $$index, $$typeName };\n }\n\n /**\n * (On the frontend) Serializes a value to JSON string, recursively replacing any MochaObjs with appropriate handles\n * TODO: There are ***surely*** more performant ways to do this...\n *\n * @param root The root object to serialize. If this is a MochaObj, it will always include all\n * properties (even if it should already exist in the backend's registry).\n */\n public static serialize(root: any) {\n const isMochaObj = (obj: any): obj is MochaObj => (obj instanceof Mocha.Runnable || obj instanceof Mocha.Suite);\n\n const replacer = (key: string, value: any): any => {\n // Some pretty important properties of Errors are not enumerable, so we need to special handle them here:\n if (value instanceof Error)\n return { ...value, name: value.name, message: value.message, stack: value.stack };\n\n if (key === \"\" || !isMochaObj(value))\n return value;\n\n return JSON.parse(JSON.stringify(this.createHandle(value, false), replacer));\n };\n\n return JSON.stringify(isMochaObj(root) ? this.createHandle(root, true) : root, replacer);\n }\n\n /**\n * (On the backend) Deserializes a JSON string, replacing any MochaObj handles with their corresponding instances.\n * The first time we encounter a given instance's handle, we'll transform that handle object to serve as the actual instance on the backend.\n */\n public static deserialize(txt: string): any {\n return JSON.parse(txt, (_key, value) => {\n // We only need to special-case our \"handle\" objects, and we'll assume anything with `$$index` fits the bill.\n if (typeof value !== \"object\" || value === null || typeof value.$$index !== \"number\")\n return value;\n\n // Try to lookup this handle's instance in our registry\n const existing = this._registry[value.$$index];\n if (existing) {\n // Update property values (in case they've changed)\n for (const name of Object.getOwnPropertyNames(value)) {\n (existing as any)[name] = value[name];\n }\n return existing;\n }\n\n // Set the prototype and add the handle to the registry - we can now treat this as (essentially) the real instance.\n Object.setPrototypeOf(value, require(\"mocha\")[value.$$typeName].prototype);\n this._registry[value.$$index] = value;\n return value;\n });\n }\n}\n\nif (typeof global !== \"undefined\")\n (global as any).MochaSerializer = MochaSerializer;\n"]}
1
+ {"version":3,"file":"MochaSerializer.js","sourceRoot":"","sources":["../../../src/runners/chrome/MochaSerializer.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F,iHAAiH;AAKjH;;;;;;;;;;;GAWG;AACH,MAAM,eAAe;IACX,MAAM,CAAC,SAAS,GAAe,EAAE,CAAC;IAEnC,MAAM,CAAC,YAAY,CAAC,GAAa,EAAE,SAAkB;QAC1D,IAAI,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC1C,gI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,KAAK,WAAW;IAC9B,MAAc,CAAC,eAAe,GAAG,eAAe,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n// NB: This file is not a CommonJs module - it needs to run in the browser. Do not import or export modules here!\n\n// Object types we need to handle specially when serializing/deserializing\ntype MochaObj = Mocha.Runnable | Mocha.Suite;\n\n/**\n * Helper for marshalling certain mocha objects between frontend and backend processes.\n *\n * Normally, playwright automatically uses JSON to serialize and deserialize arguments to backend functions exposed via `page.exposeFunction()`.\n * However, we face two problems when trying to pass `Mocha.Runnable` and `Mocha.Suite` instances to the backend:\n * - These objects have circular references\n * - JSON round-tripping won't preserve these objects' prototypes, and thus will be missing methods that reporters rely on.\n *\n * This class attempts to solve this by replacing all instances of these classes with \"handles\" that simply refer to their\n * index in a central \"registry\" array. Because we serialize and deserialize in the same order, we can re-create this \"registry\"\n * on the backend as we deserialize.\n */\nclass MochaSerializer {\n private static _registry: MochaObj[] = [];\n\n public static createHandle(raw: MochaObj, isPrimary: boolean) {\n let $$index = this._registry.indexOf(raw);\n // Browser side of mocha is webpacked so the constructor name has an added suffix for example `Test` is converted into `Test$4`.\n // This is not the case is node side of mocha, so an error is thrown because of this mismatch. The `.replace()` is there to strip that suffix\n let $$typeName: string;\n if (raw instanceof Mocha.Suite)\n $$typeName = \"Suite\";\n else if (raw instanceof Mocha.Test)\n $$typeName = \"Test\";\n else if (raw instanceof Mocha.Hook)\n $$typeName = \"Hook\";\n else\n throw new Error(\"Unexpected instance of Mocha\");\n\n if ($$index < 0) {\n $$index = this._registry.push(raw) - 1;\n // This is a new instance, so we also need to include its properties\n isPrimary = true;\n }\n\n return (isPrimary) ? { $$index, $$typeName, ...raw } : { $$index, $$typeName };\n }\n\n /**\n * (On the frontend) Serializes a value to JSON string, recursively replacing any MochaObjs with appropriate handles\n * TODO: There are ***surely*** more performant ways to do this...\n *\n * @param root The root object to serialize. If this is a MochaObj, it will always include all\n * properties (even if it should already exist in the backend's registry).\n */\n public static serialize(root: any) {\n const isMochaObj = (obj: any): obj is MochaObj => (obj instanceof Mocha.Runnable || obj instanceof Mocha.Suite);\n\n const replacer = (key: string, value: any): any => {\n // Some pretty important properties of Errors are not enumerable, so we need to special handle them here:\n if (value instanceof Error)\n return { ...value, name: value.name, message: value.message, stack: value.stack };\n\n if (key === \"\" || !isMochaObj(value))\n return value;\n\n return JSON.parse(JSON.stringify(this.createHandle(value, false), replacer));\n };\n\n return JSON.stringify(isMochaObj(root) ? this.createHandle(root, true) : root, replacer);\n }\n\n /**\n * (On the backend) Deserializes a JSON string, replacing any MochaObj handles with their corresponding instances.\n * The first time we encounter a given instance's handle, we'll transform that handle object to serve as the actual instance on the backend.\n */\n public static deserialize(txt: string): any {\n return JSON.parse(txt, (_key, value) => {\n // We only need to special-case our \"handle\" objects, and we'll assume anything with `$$index` fits the bill.\n if (typeof value !== \"object\" || value === null || typeof value.$$index !== \"number\")\n return value;\n\n // Try to lookup this handle's instance in our registry\n const existing = this._registry[value.$$index];\n if (existing) {\n // Update property values (in case they've changed)\n for (const name of Object.getOwnPropertyNames(value)) {\n (existing as any)[name] = value[name];\n }\n return existing;\n }\n\n // Set the prototype and add the handle to the registry - we can now treat this as (essentially) the real instance.\n Object.setPrototypeOf(value, require(\"mocha\")[value.$$typeName].prototype);\n this._registry[value.$$index] = value;\n return value;\n });\n }\n}\n\nif (typeof global !== \"undefined\")\n (global as any).MochaSerializer = MochaSerializer;\n"]}
@@ -10,6 +10,8 @@ const path = require("path");
10
10
  const CallbackUtils_1 = require("../../utils/CallbackUtils");
11
11
  const SpawnUtils_1 = require("../../utils/SpawnUtils");
12
12
  class ElectronTestRunner {
13
+ static supportsCoverage = false;
14
+ static supportsCleanup = false;
13
15
  static async initialize(config) {
14
16
  // Restart under electron if we're running in node
15
17
  if (!("electron" in process.versions))
@@ -72,6 +74,4 @@ class ElectronTestRunner {
72
74
  }
73
75
  }
74
76
  exports.ElectronTestRunner = ElectronTestRunner;
75
- ElectronTestRunner.supportsCoverage = false;
76
- ElectronTestRunner.supportsCleanup = false;
77
77
  //# sourceMappingURL=ElectronTestRunner.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ElectronTestRunner.js","sourceRoot":"","sources":["../../../src/runners/electron/ElectronTestRunner.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,yDAAyD;AACzD,6BAA6B;AAE7B,6DAAsE;AACtE,uDAA4D;AAG5D,MAAa,kBAAkB;IAGtB,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,MAAmB;QAChD,kDAAkD;QAClD,IAAI,CAAC,CAAC,UAAU,IAAI,OAAO,CAAC,QAAQ,CAAC;YACnC,OAAO,OAAO,CAAC,IAAI,CAAC,MAAM,IAAA,+BAAkB,GAAE,CAAC,CAAC;QAElD,0IAA0I;QAC1I,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;QACpC,IAAI,MAAM,CAAC,KAAK;YACd,GAAG,CAAC,WAAW,CAAC,YAAY,CAAC,uBAAuB,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC;QAEhG,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC;QAC1J,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,SAAS,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC;IACjD,CAAC;IAEM,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAmB;QAC9C,MAAM,EAAE,aAAa,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,OAAO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AK,CAAC,CAAC;YACrB,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,EAAE;gBAChD,eAAe,CAAC,CAAC,CAAC,CAAC;YACrB,CAAC,CAAC,CAAC;YACH,cAAc,CAAC,KAAK,EAAE,CAAC;QACzB,CAAC,CAAC,CAAC;QAEH,OAAO,CAAC,EAAE,CAAC,gBAAgB,EAAE,KAAK,EAAE,KAAU,EAAE,GAAQ,EAAE,EAAE;YAC1D,KAAK,CAAC,WAAW,GAAG,MAAM,IAAA,yCAAyB,EAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;QAC1E,CAAC,CAAC,CAAC;QAEH,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,iBAAiB,EAAE,KAAK,IAAI,EAAE;YAC5D,MAAM,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAC;YACjE,MAAM,UAAU,GAAG,KAAK,IAAI,EAAE,CAAC,cAAc,CAAC,WAAW,CAAC,iBAAiB,CAAC;8BACpD,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;kBAClC,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC;0BACtB,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;YAE3D,MAAM,UAAU,EAAE,CAAC;QACrB,CAAC,CAAC,CAAC;QACH,MAAM,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,4BAA4B,CAAC,CAAC,CAAC;IACpF,CAAC;;AA1EH,gDA2EC;AA1EwB,mCAAgB,GAAG,KAAK,CAAC;AACzB,kCAAe,GAAG,KAAK,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/* eslint-disable @typescript-eslint/naming-convention */\nimport * as path from \"path\";\nimport { WebPreferences } from \"electron\";\nimport { executeRegisteredCallback } from \"../../utils/CallbackUtils\";\nimport { relaunchInElectron } from \"../../utils/SpawnUtils\";\nimport { CertaConfig } from \"../../CertaConfig\";\n\nexport class ElectronTestRunner {\n public static readonly supportsCoverage = false;\n public static readonly supportsCleanup = false;\n public static async initialize(config: CertaConfig): Promise<void> {\n // Restart under electron if we're running in node\n if (!(\"electron\" in process.versions))\n return process.exit(await relaunchInElectron());\n\n // If we are running in electron, we need to append any chromium CLI switches ***before*** the 'ready' event of the app module is emitted.\n const { app } = require(\"electron\");\n if (config.debug)\n app.commandLine.appendSwitch(\"remote-debugging-port\", String(config.ports.frontendDebugging));\n\n const timeout = new Promise((_resolve, reject) => setTimeout(() => reject(new Error(\"Timed out after 2 minutes when starting electron\")), 2 * 60 * 1000));\n await Promise.race([app.whenReady(), timeout]);\n }\n\n public static async runTests(config: CertaConfig): Promise<void> {\n const { BrowserWindow, app, ipcMain } = require(\"electron\");\n\n const webPreferences: WebPreferences = {\n nodeIntegration: true,\n contextIsolation: false,\n sandbox: false,\n };\n\n const rendererWindow = new BrowserWindow({\n show: config.debug,\n webPreferences,\n });\n\n const exitElectronApp = (exitCode: number) => {\n // Passing exit code to parent process doesn't seem to work anymore with electron 10 - sending message with status instead\n // See note in SpawnUtils.onExitElectronApp\n if (process.send)\n process.send({ exitCode });\n app.exit(exitCode);\n };\n\n ipcMain.on(\"certa-console\", async (e: any, op: \"log\" | \"error\" | \"dir\", ...args: any[]) => {\n console[op](...args);\n e.returnValue = undefined; // ipcRenderer.sendSync() will hang without this\n });\n\n ipcMain.on(\"certa-done\", (_e: any, count: number) => {\n rendererWindow.webContents.once(\"destroyed\", () => {\n exitElectronApp(count);\n });\n setImmediate(() => rendererWindow.close());\n });\n\n ipcMain.on(\"certa-error\", (_e: any, { message, stack }: any) => {\n console.error(\"Uncaught Error in Tests: \", message);\n console.error(stack);\n rendererWindow.webContents.once(\"destroyed\", () => {\n exitElectronApp(1);\n });\n rendererWindow.close();\n });\n\n ipcMain.on(\"certa-callback\", async (event: any, msg: any) => {\n event.returnValue = await executeRegisteredCallback(msg.name, msg.args);\n });\n\n rendererWindow.webContents.once(\"did-finish-load\", async () => {\n const initScriptPath = require.resolve(\"./initElectronTests.js\");\n const startTests = async () => rendererWindow.webContents.executeJavaScript(`\n var _CERTA_CONFIG = ${JSON.stringify(config)};\n require(${JSON.stringify(initScriptPath)});\n startCertaTests(${JSON.stringify(config.testBundle)});`);\n\n await startTests();\n });\n await rendererWindow.loadFile(path.join(__dirname, \"../../../public/index.html\"));\n }\n}\n"]}
1
+ {"version":3,"file":"ElectronTestRunner.js","sourceRoot":"","sources":["../../../src/runners/electron/ElectronTestRunner.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,yDAAyD;AACzD,6BAA6B;AAE7B,6DAAsE;AACtE,uDAA4D;AAG5D,MAAa,kBAAkB;IACtB,MAAM,CAAU,gBAAgB,GAAG,KAAK,CAAC;IACzC,MAAM,CAAU,eAAe,GAAG,KAAK,CAAC;IACxC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,MAAmB;QAChD,kDAAkD;QAClD,IAAI,CAAC,CAAC,UAAU,IAAI,OAAO,CAAC,QAAQ,CAAC;YACnC,OAAO,OAAO,CAAC,IAAI,CAAC,MAAM,IAAA,+BAAkB,GAAE,CAAC,CAAC;QAElD,0IAA0I;QAC1I,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;QACpC,IAAI,MAAM,CAAC,KAAK;YACd,GAAG,CAAC,WAAW,CAAC,YAAY,CAAC,uBAAuB,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC;QAEhG,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,kD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SAAS,EAAE,4BAA4B,CAAC,CAAC,CAAC;IACpF,CAAC;;AA1EH,gDA2EC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/* eslint-disable @typescript-eslint/naming-convention */\nimport * as path from \"path\";\nimport { WebPreferences } from \"electron\";\nimport { executeRegisteredCallback } from \"../../utils/CallbackUtils\";\nimport { relaunchInElectron } from \"../../utils/SpawnUtils\";\nimport { CertaConfig } from \"../../CertaConfig\";\n\nexport class ElectronTestRunner {\n public static readonly supportsCoverage = false;\n public static readonly supportsCleanup = false;\n public static async initialize(config: CertaConfig): Promise<void> {\n // Restart under electron if we're running in node\n if (!(\"electron\" in process.versions))\n return process.exit(await relaunchInElectron());\n\n // If we are running in electron, we need to append any chromium CLI switches ***before*** the 'ready' event of the app module is emitted.\n const { app } = require(\"electron\");\n if (config.debug)\n app.commandLine.appendSwitch(\"remote-debugging-port\", String(config.ports.frontendDebugging));\n\n const timeout = new Promise((_resolve, reject) => setTimeout(() => reject(new Error(\"Timed out after 2 minutes when starting electron\")), 2 * 60 * 1000));\n await Promise.race([app.whenReady(), timeout]);\n }\n\n public static async runTests(config: CertaConfig): Promise<void> {\n const { BrowserWindow, app, ipcMain } = require(\"electron\");\n\n const webPreferences: WebPreferences = {\n nodeIntegration: true,\n contextIsolation: false,\n sandbox: false,\n };\n\n const rendererWindow = new BrowserWindow({\n show: config.debug,\n webPreferences,\n });\n\n const exitElectronApp = (exitCode: number) => {\n // Passing exit code to parent process doesn't seem to work anymore with electron 10 - sending message with status instead\n // See note in SpawnUtils.onExitElectronApp\n if (process.send)\n process.send({ exitCode });\n app.exit(exitCode);\n };\n\n ipcMain.on(\"certa-console\", async (e: any, op: \"log\" | \"error\" | \"dir\", ...args: any[]) => {\n console[op](...args);\n e.returnValue = undefined; // ipcRenderer.sendSync() will hang without this\n });\n\n ipcMain.on(\"certa-done\", (_e: any, count: number) => {\n rendererWindow.webContents.once(\"destroyed\", () => {\n exitElectronApp(count);\n });\n setImmediate(() => rendererWindow.close());\n });\n\n ipcMain.on(\"certa-error\", (_e: any, { message, stack }: any) => {\n console.error(\"Uncaught Error in Tests: \", message);\n console.error(stack);\n rendererWindow.webContents.once(\"destroyed\", () => {\n exitElectronApp(1);\n });\n rendererWindow.close();\n });\n\n ipcMain.on(\"certa-callback\", async (event: any, msg: any) => {\n event.returnValue = await executeRegisteredCallback(msg.name, msg.args);\n });\n\n rendererWindow.webContents.once(\"did-finish-load\", async () => {\n const initScriptPath = require.resolve(\"./initElectronTests.js\");\n const startTests = async () => rendererWindow.webContents.executeJavaScript(`\n var _CERTA_CONFIG = ${JSON.stringify(config)};\n require(${JSON.stringify(initScriptPath)});\n startCertaTests(${JSON.stringify(config.testBundle)});`);\n\n await startTests();\n });\n await rendererWindow.loadFile(path.join(__dirname, \"../../../public/index.html\"));\n }\n}\n"]}
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.NodeTestRunner = void 0;
4
4
  const Mocha = require("mocha");
5
5
  class NodeTestRunner {
6
+ static supportsCoverage = true;
7
+ static supportsCleanup = true;
6
8
  static async runTests(config) {
7
9
  // Initialize mocha
8
10
  global.mocha = new Mocha();
@@ -19,6 +21,4 @@ class NodeTestRunner {
19
21
  }
20
22
  }
21
23
  exports.NodeTestRunner = NodeTestRunner;
22
- NodeTestRunner.supportsCoverage = true;
23
- NodeTestRunner.supportsCleanup = true;
24
24
  //# sourceMappingURL=NodeTestRunner.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NodeTestRunner.js","sourceRoot":"","sources":["../../../src/runners/node/NodeTestRunner.ts"],"names":[],"mappings":";;;AAKA,+BAAgC;AAIhC,MAAa,cAAc;IAGlB,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAmB;QAC9C,mBAAmB;QACnB,MAAM,CAAC,KAAK,GAAG,IAAI,KAAK,EAAE,CAAC;QAC3B,MAAM,CAAC,aAAa,GAAG,MAAM,CAAC;QAC9B,OAAO,CAAC,uBAAuB,CAAC,CAAC;QAEjC,oBAAoB;QACpB,MAAM,CAAC,gBAAgB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;QACxD,OAAO,CAAC,4BAA4B,CAAC,CAAC;QAEtC,aAAa;QACb,MAAM,cAAc,GAAG,CAAC,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,sBAAsB,CAAC,IAAI,MAAM,CAAC,UAAU,CAAC;QAC5F,OAAO,CAAC,cAAc,CAAC,CAAC;QAExB,gBAAgB;QAChB,KAAK,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,GAAG,WAAW,CAAC,CAAC;IAC7D,CAAC;;AAnBH,wCAoBC;AAnBwB,+BAAgB,GAAG,IAAI,CAAC;AACxB,8BAAe,GAAG,IAAI,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { CertaConfig } from \"../../CertaConfig\";\nimport Mocha = require(\"mocha\");\n\ndeclare const global: any;\n\nexport class NodeTestRunner {\n public static readonly supportsCoverage = true;\n public static readonly supportsCleanup = true;\n public static async runTests(config: CertaConfig): Promise<void> {\n // Initialize mocha\n global.mocha = new Mocha();\n global._CERTA_CONFIG = config;\n require(\"../../utils/initMocha\");\n\n // Setup source maps\n global.sourceMapSupport = require(\"source-map-support\");\n require(\"../../utils/initSourceMaps\");\n\n // Load tests\n const frontendBundle = (config.cover && config.instrumentedTestBundle) || config.testBundle;\n require(frontendBundle);\n\n // Execute tests\n mocha.run((failedCount) => process.exitCode = failedCount);\n }\n}\n"]}
1
+ {"version":3,"file":"NodeTestRunner.js","sourceRoot":"","sources":["../../../src/runners/node/NodeTestRunner.ts"],"names":[],"mappings":";;;AAKA,+BAAgC;AAIhC,MAAa,cAAc;IAClB,MAAM,CAAU,gBAAgB,GAAG,IAAI,CAAC;IACxC,MAAM,CAAU,eAAe,GAAG,IAAI,CAAC;IACvC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAmB;QAC9C,mBAAmB;QACnB,MAAM,CAAC,KAAK,GAAG,IAAI,KAAK,EAAE,CAAC;QAC3B,MAAM,CAAC,aAAa,GAAG,MAAM,CAAC;QAC9B,OAAO,CAAC,uBAAuB,CAAC,CAAC;QAEjC,oBAAoB;QACpB,MAAM,CAAC,gBAAgB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;QACxD,OAAO,CAAC,4BAA4B,CAAC,CAAC;QAEtC,aAAa;QACb,MAAM,cAAc,GAAG,CAAC,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,sBAAsB,CAAC,IAAI,MAAM,CAAC,UAAU,CAAC;QAC5F,OAAO,CAAC,cAAc,CAAC,CAAC;QAExB,gBAAgB;QAChB,KAAK,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,GAAG,WAAW,CAAC,CAAC;IAC7D,CAAC;;AAnBH,wCAoBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { CertaConfig } from \"../../CertaConfig\";\nimport Mocha = require(\"mocha\");\n\ndeclare const global: any;\n\nexport class NodeTestRunner {\n public static readonly supportsCoverage = true;\n public static readonly supportsCleanup = true;\n public static async runTests(config: CertaConfig): Promise<void> {\n // Initialize mocha\n global.mocha = new Mocha();\n global._CERTA_CONFIG = config;\n require(\"../../utils/initMocha\");\n\n // Setup source maps\n global.sourceMapSupport = require(\"source-map-support\");\n require(\"../../utils/initSourceMaps\");\n\n // Load tests\n const frontendBundle = (config.cover && config.instrumentedTestBundle) || config.testBundle;\n require(frontendBundle);\n\n // Execute tests\n mocha.run((failedCount) => process.exitCode = failedCount);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"initSourceMaps.d.ts","sourceRoot":"","sources":["../../src/utils/initSourceMaps.ts"],"names":[],"mappings":"AAOA,OAAO,CAAC,MAAM,gBAAgB,EAAE,GAAG,CAAC;AAKpC,QAAA,MAAM,yBAAyB,6BARyB,OAAO,QAAQ,uBAQd,CAAC"}
1
+ {"version":3,"file":"initSourceMaps.d.ts","sourceRoot":"","sources":["../../src/utils/initSourceMaps.ts"],"names":[],"mappings":"AAOA,OAAO,CAAC,MAAM,gBAAgB,EAAE,GAAG,CAAC;AAKpC,QAAA,MAAM,yBAAyB,6BAKuzF,OAAQ,QAAQ,uBAL7yF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/certa",
3
- "version": "5.0.0-dev.8",
3
+ "version": "5.0.0-dev.82",
4
4
  "description": "A mocha-based integration test runner",
5
5
  "license": "MIT",
6
6
  "main": "bin/certa.js",
@@ -25,10 +25,10 @@
25
25
  "dependencies": {
26
26
  "canonical-path": "^1.0.0",
27
27
  "detect-port": "~1.3.0",
28
- "express": "^4.20.0",
28
+ "express": "^4.21.2",
29
29
  "jsonc-parser": "~2.0.3",
30
30
  "lodash": "^4.17.21",
31
- "mocha": "^10.2.0",
31
+ "mocha": "^11.1.0",
32
32
  "playwright": "~1.47.1",
33
33
  "source-map-support": "^0.5.6",
34
34
  "yargs": "^17.4.0"
@@ -40,17 +40,17 @@
40
40
  "@types/express": "^4.17.20",
41
41
  "@types/lodash": "^4.14.202",
42
42
  "@types/mocha": "^10.0.6",
43
- "@types/node": "~20.9.5",
43
+ "@types/node": "~20.17.0",
44
44
  "@types/yargs": "17.0.19",
45
- "electron": "^33.0.0",
45
+ "electron": "^35.0.0",
46
46
  "eslint": "^9.13.0",
47
- "nyc": "^15.1.0",
48
- "rimraf": "^3.0.2",
47
+ "nyc": "^17.1.0",
48
+ "rimraf": "^6.0.1",
49
49
  "typescript": "~5.6.2",
50
- "@itwin/build-tools": "5.0.0-dev.8"
50
+ "@itwin/build-tools": "5.0.0-dev.82"
51
51
  },
52
52
  "peerDependencies": {
53
- "electron": "^33.0.0"
53
+ "electron": "^35.0.0"
54
54
  },
55
55
  "peerDependenciesMeta": {
56
56
  "electron": {
@@ -59,7 +59,7 @@
59
59
  },
60
60
  "scripts": {
61
61
  "build": "tsc 1>&2",
62
- "clean": "rimraf lib .rush/temp/package-deps*.json",
62
+ "clean": "rimraf -g lib .rush/temp/package-deps*.json",
63
63
  "lint": "eslint \"./src/**/*.ts\" 1>&2",
64
64
  "test": "",
65
65
  "docs": "",