@itwin/certa 4.10.0-dev.32 → 4.10.0-dev.34
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/lib/CertaConfig.js.map +1 -1
- package/lib/CertaCore.js.map +1 -1
- package/lib/runners/chrome/ChromeTestRunner.js +2 -2
- package/lib/runners/chrome/ChromeTestRunner.js.map +1 -1
- package/lib/runners/chrome/webserver.js +1 -2
- package/lib/runners/chrome/webserver.js.map +1 -1
- package/lib/runners/electron/ElectronTestRunner.js +2 -2
- package/lib/runners/electron/ElectronTestRunner.js.map +1 -1
- package/lib/utils/initMocha.js.map +1 -1
- package/package.json +5 -5
package/lib/CertaConfig.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CertaConfig.js","sourceRoot":"","sources":["../src/CertaConfig.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,yBAAyB;AACzB,6BAA6B;AAC7B,iCAAiC;AACjC,+CAAqC;AA2FrC,MAAM,OAAO,GAAG,IAAI,CAAC;AACrB,MAAM,OAAO,GAAG,EAAE,GAAG,OAAO,CAAC;AAE7B,IAAiB,WAAW,CAiF3B;AAjFD,WAAiB,WAAW;IACb,oBAAQ,GAAG;QACtB,KAAK,EAAE,KAAK;QACZ,KAAK,EAAE,KAAK;QACZ,KAAK,EAAE;YACL,SAAS,EAAE,IAAI;YACf,QAAQ,EAAE,IAAI;YACd,iBAAiB,EAAE,IAAI;SACxB;QACD,YAAY,EAAE;YACZ,MAAM,EAAE,KAAK;YACb,OAAO,EAAE,CAAC,GAAG,OAAO;YACpB,QAAQ,EAAE,MAAM;SACjB;QACD,aAAa,EAAE;YACb,uGAAuG;YACvG,IAAI,EAAE,IAAI,KAAK,EAAU;YACzB,UAAU,EAAE,IAAI,KAAK,EAAU;SAChC;KACF,CAAC;IAEF,mGAAmG;IACnG,MAAM,aAAa,GAAG;QACpB,mBAAmB;QACnB,YAAY;QACZ,wBAAwB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C,YAAY,CAAC,QAAQ,CAAC,CAAC;QAC/C,MAAM,QAAQ,GAAG,IAAA,oBAAK,EAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,4DAA4D;QAC7G,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,CAAC;QAC/C,OAAO,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;IAC9D,CAAC;IALe,0BAAc,iBAK7B,CAAA;AACH,CAAC,EAjFgB,WAAW,2BAAX,WAAW,QAiF3B","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nimport * as fs from \"fs\";\r\nimport * as path from \"path\";\r\nimport * as lodash from \"lodash\";\r\nimport { parse } from \"jsonc-parser\";\r\n\r\n/** Defines mocha options common to all test runners. */\r\nexport interface CertaMochaOpts {\r\n /** The default hook and test-case timeout, in milliseconds. */\r\n timeout: number;\r\n /** A regular expression test filter - only tests matching this expression will be run. */\r\n grep?: string;\r\n /** A string test filter - only tests containing this string will be run. */\r\n fgrep?: string;\r\n /** Whether `grep` and `fgrep` matches should be inverted. */\r\n invert: boolean;\r\n /** Causes tests marked `only` to fail the suite. */\r\n forbidOnly: boolean;\r\n /** The name of a (built-in) mocha reporter to use. */\r\n reporter: string;\r\n /** Mocha reporter-specific options. */\r\n reporterOptions?: object;\r\n}\r\n\r\n/** Defines options specific to the chrome test runner */\r\nexport interface CertaChromeOpts {\r\n /** Array of additional chrome arguments. */\r\n args: string[];\r\n /** Array of absolute paths to directories that contain static assets which should be made available via the frontend webserver. */\r\n publicDirs: string[];\r\n}\r\n\r\n/** Defines ports that certa may listen on. */\r\nexport interface CertaPortOpts {\r\n /** The port that will be used by the v8 inspector in the \"main\" process to communicate with a debugger (when the `debug` option is enabled). */\r\n debugging: number;\r\n /** `[Chrome Only]` The port that will be used by to serve test assets to the frontend. */\r\n frontend: number;\r\n /** `[Chrome and Electron Only]` The port that will be used for remote debugging (when the `debug` option is enabled). */\r\n frontendDebugging: number;\r\n}\r\n\r\nexport interface PartialCertaConfig {\r\n testBundle: string;\r\n instrumentedTestBundle?: string;\r\n backendInitModule?: string;\r\n debug?: boolean;\r\n ports?: Partial<CertaPortOpts>;\r\n mochaOptions?: Partial<CertaMochaOpts>;\r\n chromeOptions?: Partial<CertaChromeOpts>;\r\n}\r\n\r\n/** Certa configuration options. */\r\nexport interface CertaConfig {\r\n\r\n /** The absolute path to a JavaScript file containing all mocha tests to be run. */\r\n readonly testBundle: string;\r\n\r\n /**\r\n * An instanbul-instrumented version of the `testBundle`.\r\n * This will be used instead of `testBundle` when running with `cover` enabled.\r\n */\r\n readonly instrumentedTestBundle?: string;\r\n\r\n /**\r\n * The absolute path to a JavaScript module containing backend initialization logic.\r\n * This module will be required in Certa's \"main\" process ***before*** initializing a test runner.\r\n * If the file's `module.exports` is a Promise, that Promise will also be awaited before running tests.\r\n * The exported Promise may also optionally be resolved with a \"cleanup\" async callback, which will be executed _after_ running tests (not supported in electron).\r\n * @optional\r\n */\r\n readonly backendInitModule?: string;\r\n\r\n /**\r\n * Whether Certa should run in \"debug mode\".\r\n * When debug mode is enabled, chrome and electron windows will be visible and remote debugging is enabled.\r\n */\r\n readonly debug: boolean;\r\n\r\n /**\r\n * Whether Certa should measure code coverage.\r\n * NB: This is currently only supported by the chrome and node test runners.\r\n */\r\n readonly cover: boolean;\r\n\r\n /** Defines ports used by the chrome and electron test runners. */\r\n readonly ports: Readonly<CertaPortOpts>;\r\n\r\n /** Defines mocha options common to all test runners. */\r\n readonly mochaOptions: Readonly<CertaMochaOpts>;\r\n\r\n /** Defines options specific to the chrome test runner */\r\n readonly chromeOptions: Readonly<CertaChromeOpts>;\r\n}\r\n\r\nconst SECONDS = 1000;\r\nconst MINUTES = 60 * SECONDS;\r\n\r\nexport namespace CertaConfig {\r\n export const defaults = {\r\n debug: false,\r\n cover: false,\r\n ports: {\r\n debugging: 5858,\r\n frontend: 3000,\r\n frontendDebugging: 9223,\r\n },\r\n mochaOptions: {\r\n invert: false,\r\n timeout: 2 * MINUTES,\r\n reporter: \"spec\",\r\n },\r\n chromeOptions: {\r\n // NB: These should stay **empty** arrays, otherwise lodash.defaultsDeep will not merge them correctly.\r\n args: new Array<string>(),\r\n publicDirs: new Array<string>(),\r\n },\r\n };\r\n\r\n // List of config options that may be relative file paths and should be resolved to absolute paths.\r\n const _filePathOpts = [
|
|
1
|
+
{"version":3,"file":"CertaConfig.js","sourceRoot":"","sources":["../src/CertaConfig.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,yBAAyB;AACzB,6BAA6B;AAC7B,iCAAiC;AACjC,+CAAqC;AA2FrC,MAAM,OAAO,GAAG,IAAI,CAAC;AACrB,MAAM,OAAO,GAAG,EAAE,GAAG,OAAO,CAAC;AAE7B,IAAiB,WAAW,CAiF3B;AAjFD,WAAiB,WAAW;IACb,oBAAQ,GAAG;QACtB,KAAK,EAAE,KAAK;QACZ,KAAK,EAAE,KAAK;QACZ,KAAK,EAAE;YACL,SAAS,EAAE,IAAI;YACf,QAAQ,EAAE,IAAI;YACd,iBAAiB,EAAE,IAAI;SACxB;QACD,YAAY,EAAE;YACZ,MAAM,EAAE,KAAK;YACb,OAAO,EAAE,CAAC,GAAG,OAAO;YACpB,QAAQ,EAAE,MAAM;SACjB;QACD,aAAa,EAAE;YACb,uGAAuG;YACvG,IAAI,EAAE,IAAI,KAAK,EAAU;YACzB,UAAU,EAAE,IAAI,KAAK,EAAU;SAChC;KACF,CAAC;IAEF,mGAAmG;IACnG,MAAM,aAAa,GAAG;QACpB,mBAAmB;QACnB,YAAY;QACZ,wBAAwB;QACxB,0BAA0B;KAC3B,CAAC;IAEF;;;;;OAKG;IACH,SAAS,YAAY,CAAC,OAAe,EAAE,IAAwB;QAC7D,KAA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EAAE,CAAC,CAAC,CAAC,4DAA4D;QAC7G,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,CAAC;QAC/C,OAAO,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;IAC9D,CAAC;IALe,0BAAc,iBAK7B,CAAA;AACH,CAAC,EAjFgB,WAAW,2BAAX,WAAW,QAiF3B","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nimport * as fs from \"fs\";\r\nimport * as path from \"path\";\r\nimport * as lodash from \"lodash\";\r\nimport { parse } from \"jsonc-parser\";\r\n\r\n/** Defines mocha options common to all test runners. */\r\nexport interface CertaMochaOpts {\r\n /** The default hook and test-case timeout, in milliseconds. */\r\n timeout: number;\r\n /** A regular expression test filter - only tests matching this expression will be run. */\r\n grep?: string;\r\n /** A string test filter - only tests containing this string will be run. */\r\n fgrep?: string;\r\n /** Whether `grep` and `fgrep` matches should be inverted. */\r\n invert: boolean;\r\n /** Causes tests marked `only` to fail the suite. */\r\n forbidOnly: boolean;\r\n /** The name of a (built-in) mocha reporter to use. */\r\n reporter: string;\r\n /** Mocha reporter-specific options. */\r\n reporterOptions?: object;\r\n}\r\n\r\n/** Defines options specific to the chrome test runner */\r\nexport interface CertaChromeOpts {\r\n /** Array of additional chrome arguments. */\r\n args: string[];\r\n /** Array of absolute paths to directories that contain static assets which should be made available via the frontend webserver. */\r\n publicDirs: string[];\r\n}\r\n\r\n/** Defines ports that certa may listen on. */\r\nexport interface CertaPortOpts {\r\n /** The port that will be used by the v8 inspector in the \"main\" process to communicate with a debugger (when the `debug` option is enabled). */\r\n debugging: number;\r\n /** `[Chrome Only]` The port that will be used by to serve test assets to the frontend. */\r\n frontend: number;\r\n /** `[Chrome and Electron Only]` The port that will be used for remote debugging (when the `debug` option is enabled). */\r\n frontendDebugging: number;\r\n}\r\n\r\nexport interface PartialCertaConfig {\r\n testBundle: string;\r\n instrumentedTestBundle?: string;\r\n backendInitModule?: string;\r\n debug?: boolean;\r\n ports?: Partial<CertaPortOpts>;\r\n mochaOptions?: Partial<CertaMochaOpts>;\r\n chromeOptions?: Partial<CertaChromeOpts>;\r\n}\r\n\r\n/** Certa configuration options. */\r\nexport interface CertaConfig {\r\n\r\n /** The absolute path to a JavaScript file containing all mocha tests to be run. */\r\n readonly testBundle: string;\r\n\r\n /**\r\n * An instanbul-instrumented version of the `testBundle`.\r\n * This will be used instead of `testBundle` when running with `cover` enabled.\r\n */\r\n readonly instrumentedTestBundle?: string;\r\n\r\n /**\r\n * The absolute path to a JavaScript module containing backend initialization logic.\r\n * This module will be required in Certa's \"main\" process ***before*** initializing a test runner.\r\n * If the file's `module.exports` is a Promise, that Promise will also be awaited before running tests.\r\n * The exported Promise may also optionally be resolved with a \"cleanup\" async callback, which will be executed _after_ running tests (not supported in electron).\r\n * @optional\r\n */\r\n readonly backendInitModule?: string;\r\n\r\n /**\r\n * Whether Certa should run in \"debug mode\".\r\n * When debug mode is enabled, chrome and electron windows will be visible and remote debugging is enabled.\r\n */\r\n readonly debug: boolean;\r\n\r\n /**\r\n * Whether Certa should measure code coverage.\r\n * NB: This is currently only supported by the chrome and node test runners.\r\n */\r\n readonly cover: boolean;\r\n\r\n /** Defines ports used by the chrome and electron test runners. */\r\n readonly ports: Readonly<CertaPortOpts>;\r\n\r\n /** Defines mocha options common to all test runners. */\r\n readonly mochaOptions: Readonly<CertaMochaOpts>;\r\n\r\n /** Defines options specific to the chrome test runner */\r\n readonly chromeOptions: Readonly<CertaChromeOpts>;\r\n}\r\n\r\nconst SECONDS = 1000;\r\nconst MINUTES = 60 * SECONDS;\r\n\r\nexport namespace CertaConfig {\r\n export const defaults = {\r\n debug: false,\r\n cover: false,\r\n ports: {\r\n debugging: 5858,\r\n frontend: 3000,\r\n frontendDebugging: 9223,\r\n },\r\n mochaOptions: {\r\n invert: false,\r\n timeout: 2 * MINUTES,\r\n reporter: \"spec\",\r\n },\r\n chromeOptions: {\r\n // NB: These should stay **empty** arrays, otherwise lodash.defaultsDeep will not merge them correctly.\r\n args: new Array<string>(),\r\n publicDirs: new Array<string>(),\r\n },\r\n };\r\n\r\n // List of config options that may be relative file paths and should be resolved to absolute paths.\r\n const _filePathOpts = [\r\n \"backendInitModule\",\r\n \"testBundle\",\r\n \"instrumentedTestBundle\",\r\n \"chromeOptions.publicDirs\",\r\n ];\r\n\r\n /**\r\n * Resolves all relative file paths in `opts` to absolute paths, starting from `baseDir`.\r\n * NB: This mutates `opts`.\r\n * @param baseDir The starting point for resolving relative paths.\r\n * @param opts A partial CertaConfig object.\r\n */\r\n function resolvePaths(baseDir: string, opts: PartialCertaConfig): void {\r\n for (const propPath of _filePathOpts) {\r\n const relativeFilePath = lodash.get(opts, propPath);\r\n if (relativeFilePath) {\r\n if (Array.isArray(relativeFilePath))\r\n lodash.set(opts, propPath, relativeFilePath.map((p) => path.resolve(baseDir, p)));\r\n else\r\n lodash.set(opts, propPath, path.resolve(baseDir, relativeFilePath));\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Creates a complete CertaConfig object by combining a partial config with default values.\r\n * All relative paths are resolved from the current working directory.\r\n * Throws if the `testBundle` option is undefined or invalid.\r\n * @param opts A partial CertaConfig object.\r\n */\r\n export function fromObject(opts: PartialCertaConfig): CertaConfig {\r\n const resolvedOpts = lodash.defaultsDeep(opts, defaults);\r\n resolvePaths(process.cwd(), resolvedOpts);\r\n\r\n if (!resolvedOpts.testBundle)\r\n throw new Error(\"The required testBundle option was not set.\");\r\n\r\n if (!fs.existsSync(resolvedOpts.testBundle))\r\n throw new Error(`The specified testBundle file \"${resolvedOpts.testBundle}\" does not exist.`);\r\n\r\n return resolvedOpts;\r\n }\r\n\r\n /**\r\n * Creates a complete CertaConfig object by loading options from a certa.json config file,\r\n * applying run-time overrides, then combining that with default values.\r\n * All relative paths specified in the config file are resolved from the config file directory.\r\n * All other relative paths (overrides or defaults) are resolved from the current working directory.\r\n * Throws if the `testBundle` option is undefined or invalid.\r\n * @param filePath The path to a certa.json config file.\r\n * @param overrides A partial CertaConfig object. These values will always override any options set in the config file.\r\n */\r\n export function fromConfigFile(filePath: string, overrides: PartialCertaConfig): CertaConfig {\r\n const fileContents = fs.readFileSync(filePath);\r\n const fileOpts = parse(fileContents.toString()); // Parsing with jsonc-parser lets us safely handle comments.\r\n resolvePaths(path.dirname(filePath), fileOpts);\r\n return fromObject(lodash.defaultsDeep(overrides, fileOpts));\r\n }\r\n}\r\n"]}
|
package/lib/CertaCore.js.map
CHANGED
|
@@ -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,u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C;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":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nimport { ElectronTestRunner } from \"./runners/electron/ElectronTestRunner\";\r\nimport { ChromeTestRunner } from \"./runners/chrome/ChromeTestRunner\";\r\nimport { CertaConfig } from \"./CertaConfig\";\r\nimport { NodeTestRunner } from \"./runners/node/NodeTestRunner\";\r\nimport { relaunchForCoverage } from \"./utils/CoverageUtils\";\r\nimport { startDebugger } from \"./utils/SpawnUtils\";\r\n\r\nexport interface CertaTestRunner {\r\n readonly supportsCoverage: boolean;\r\n readonly supportsCleanup: boolean;\r\n initialize?(config: CertaConfig): Promise<void>;\r\n runTests(config: CertaConfig): Promise<void>;\r\n}\r\n\r\nexport class CertaCore {\r\n private static _runners: { [environment: string]: CertaTestRunner } = {};\r\n\r\n public static registerTestRunner(environment: string, runner: CertaTestRunner) {\r\n this._runners[environment] = runner;\r\n }\r\n\r\n public static getTestRunner(environment: string): CertaTestRunner {\r\n if (environment in this._runners)\r\n return this._runners[environment];\r\n\r\n throw new Error(`Unknown TestRunner: \"${environment}\"`);\r\n }\r\n}\r\n\r\nCertaCore.registerTestRunner(\"node\", NodeTestRunner);\r\nCertaCore.registerTestRunner(\"chrome\", ChromeTestRunner);\r\nCertaCore.registerTestRunner(\"electron\", ElectronTestRunner);\r\n\r\nexport async function certa(environment: string, config: CertaConfig): Promise<void> {\r\n const runner = CertaCore.getTestRunner(environment);\r\n\r\n // If we're going to measure code coverage, we should stop now and let an `nyc`-wrapped child process take it from here.\r\n const alreadyInNyc = process.env.NYC_CWD !== undefined;\r\n if (config.cover && runner.supportsCoverage && !alreadyInNyc)\r\n return process.exit(await relaunchForCoverage());\r\n\r\n if (runner.initialize)\r\n await runner.initialize(config);\r\n\r\n // In debug mode, we should now start listening for debugger connections (if we're not already).\r\n if (config.debug)\r\n startDebugger(config.ports.debugging);\r\n\r\n // Source map any errors in this backend process\r\n require(\"source-map-support\").install();\r\n\r\n /**\r\n * undefined if backendInitModule not specified;\r\n * callback if a cleanup function is returned by the backendInitModule export;\r\n * empty object if nothing is exported by the backendInitModule\r\n */\r\n let cleanUpCallback: undefined | (() => Promise<void>) | object;\r\n if (config.backendInitModule)\r\n cleanUpCallback = await require(config.backendInitModule);\r\n\r\n await runner.runTests(config);\r\n\r\n if (typeof cleanUpCallback === \"function\" && runner.supportsCleanup)\r\n await cleanUpCallback();\r\n}\r\n"]}
|
|
@@ -30,7 +30,7 @@ class ChromeTestRunner {
|
|
|
30
30
|
};
|
|
31
31
|
webserverProcess = (0, SpawnUtils_1.spawnChildProcess)("node", [require.resolve("./webserver")], webserverEnv, true);
|
|
32
32
|
// Don't continue until the webserver is started and listening.
|
|
33
|
-
const webserverExited = new Promise((_resolve, reject) => webserverProcess.once("exit", () => reject("Webserver exited!")));
|
|
33
|
+
const webserverExited = new Promise((_resolve, reject) => webserverProcess.once("exit", () => reject(new Error("Webserver exited!"))));
|
|
34
34
|
const webserverStarted = new Promise((resolve) => webserverProcess.once("message", resolve));
|
|
35
35
|
const actualPort = await Promise.race([webserverExited, webserverStarted]);
|
|
36
36
|
if (actualPort !== config.ports.frontend)
|
|
@@ -96,7 +96,7 @@ async function runTestsInPlaywright(config, port) {
|
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
98
|
catch (error) {
|
|
99
|
-
reject(error);
|
|
99
|
+
reject(error); // eslint-disable-line @typescript-eslint/prefer-promise-reject-errors
|
|
100
100
|
}
|
|
101
101
|
});
|
|
102
102
|
}
|
|
@@ -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,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,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC;YAC1D,MAAM,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,kDAAkD,CAAC,CAAC,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;QAChB,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nimport * as path from \"path\";\r\nimport { Browser, chromium, LaunchOptions, Page } from \"playwright\";\r\nimport { ChildProcess } from \"child_process\";\r\nimport { spawnChildProcess } from \"../../utils/SpawnUtils\";\r\nimport { executeRegisteredCallback } from \"../../utils/CallbackUtils\";\r\nimport { CertaConfig } from \"../../CertaConfig\";\r\nimport { writeCoverageData } from \"../../utils/CoverageUtils\";\r\nimport { configureRemoteReporter } from \"./MochaRemoteReporter\";\r\n\r\ninterface ChromeTestResults {\r\n failures: number;\r\n coverage: any;\r\n}\r\n\r\ntype ConsoleMethodName = \"log\" | \"error\" | \"dir\";\r\n\r\nlet browser: Browser;\r\nlet webserverProcess: ChildProcess;\r\n\r\nexport class ChromeTestRunner {\r\n public static readonly supportsCoverage = true;\r\n public static readonly supportsCleanup = true;\r\n public static async initialize(config: CertaConfig): Promise<void> {\r\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.\r\n const options: LaunchOptions = {\r\n args: config.chromeOptions.args,\r\n headless: !config.debug,\r\n };\r\n\r\n if (config.debug)\r\n options.args?.push(`--disable-gpu`, `--remote-debugging-port=${config.ports.frontendDebugging}`);\r\n\r\n browser = await chromium.launch(options);\r\n\r\n const webserverEnv = {\r\n CERTA_PORT: `${config.ports.frontend}`, // eslint-disable-line @typescript-eslint/naming-convention\r\n CERTA_PATH: path.join(__dirname, \"../../../public/index.html\"), // eslint-disable-line @typescript-eslint/naming-convention\r\n CERTA_PUBLIC_DIRS: JSON.stringify(config.chromeOptions.publicDirs), // eslint-disable-line @typescript-eslint/naming-convention\r\n };\r\n webserverProcess = spawnChildProcess(\"node\", [require.resolve(\"./webserver\")], webserverEnv, true);\r\n\r\n // Don't continue until the webserver is started and listening.\r\n const webserverExited = new Promise<never>((_resolve, reject) => webserverProcess.once(\"exit\", () => reject(\"Webserver exited!\")));\r\n const webserverStarted = new Promise<number>((resolve) => webserverProcess.once(\"message\", resolve));\r\n const actualPort = await Promise.race([webserverExited, webserverStarted]);\r\n if (actualPort !== config.ports.frontend)\r\n console.warn(`CERTA: Port ${config.ports.frontend} was already in use, so serving test resources on port ${actualPort}`);\r\n process.env.CERTA_PORT = String(actualPort);\r\n }\r\n\r\n public static async runTests(config: CertaConfig): Promise<void> {\r\n // FIXME: Do we really want to always enforce this behavior?\r\n if (process.env.CI || process.env.TF_BUILD)\r\n (config.mochaOptions as any).forbidOnly = true;\r\n\r\n const { failures, coverage } = await runTestsInPlaywright(config, process.env.CERTA_PORT!);\r\n webserverProcess.kill();\r\n\r\n // Save nyc/istanbul coverage file.\r\n if (config.cover)\r\n writeCoverageData(coverage);\r\n\r\n process.exitCode = failures;\r\n }\r\n}\r\n\r\nasync function loadScript(page: Page, scriptPath: string) {\r\n return page.addScriptTag({ url: `/@/${scriptPath}` });\r\n}\r\n\r\nasync function runTestsInPlaywright(config: CertaConfig, port: string) {\r\n return new Promise<ChromeTestResults>(async (resolve, reject) => {\r\n try {\r\n const page = browser.contexts().pop()?.pages()?.pop() || await browser.newPage();\r\n\r\n // Don't let dialogs block tests\r\n page.on(\"dialog\", async (dialog: any) => dialog.dismiss());\r\n\r\n // Re-throw any uncaught exceptions from the frontend in the backend\r\n page.on(\"pageerror\", reject);\r\n\r\n // Expose some functions to the frontend that will execute _in the backend context_\r\n await page.exposeFunction(\"_CertaConsole\", (type: ConsoleMethodName, args: any[]) => console[type](...args));\r\n await page.exposeFunction(\"_CertaSendToBackend\", executeRegisteredCallback);\r\n await page.exposeFunction(\"_CertaReportResults\", (results: ChromeTestResults) => {\r\n setTimeout(async () => {\r\n await browser.close();\r\n resolve(results);\r\n });\r\n });\r\n\r\n // Now load the page (and requisite scripts)...\r\n const testBundle = (config.cover && config.instrumentedTestBundle) || config.testBundle;\r\n await page.goto(`http://localhost:${port}`);\r\n await page.addScriptTag({ content: `var _CERTA_CONFIG = ${JSON.stringify(config)};` });\r\n await loadScript(page, require.resolve(\"../../utils/initLogging.js\"));\r\n await loadScript(page, require.resolve(\"mocha/mocha.js\"));\r\n await loadScript(page, require.resolve(\"source-map-support/browser-source-map-support.js\"));\r\n await loadScript(page, require.resolve(\"../../utils/initSourceMaps.js\"));\r\n await loadScript(page, require.resolve(\"./MochaSerializer.js\"));\r\n await configureRemoteReporter(page);\r\n await loadScript(page, require.resolve(\"../../utils/initMocha.js\"));\r\n await loadScript(page, testBundle);\r\n\r\n // ...and start the tests\r\n await page.evaluate(async () => {\r\n // NB: This is being evaluated in the frontend context!\r\n Mocha.reporters.Base.color = true as any;\r\n const globals = window as any;\r\n mocha.run((failures) => {\r\n const coverage = globals.__coverage__;\r\n globals._CertaReportResults({ failures, coverage }); // This will close the browser\r\n });\r\n });\r\n } catch (error) {\r\n reject(error);\r\n }\r\n });\r\n}\r\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;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,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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,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":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nimport * as path from \"path\";\r\nimport { Browser, chromium, LaunchOptions, Page } from \"playwright\";\r\nimport { ChildProcess } from \"child_process\";\r\nimport { spawnChildProcess } from \"../../utils/SpawnUtils\";\r\nimport { executeRegisteredCallback } from \"../../utils/CallbackUtils\";\r\nimport { CertaConfig } from \"../../CertaConfig\";\r\nimport { writeCoverageData } from \"../../utils/CoverageUtils\";\r\nimport { configureRemoteReporter } from \"./MochaRemoteReporter\";\r\n\r\ninterface ChromeTestResults {\r\n failures: number;\r\n coverage: any;\r\n}\r\n\r\ntype ConsoleMethodName = \"log\" | \"error\" | \"dir\";\r\n\r\nlet browser: Browser;\r\nlet webserverProcess: ChildProcess;\r\n\r\nexport class ChromeTestRunner {\r\n public static readonly supportsCoverage = true;\r\n public static readonly supportsCleanup = true;\r\n public static async initialize(config: CertaConfig): Promise<void> {\r\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.\r\n const options: LaunchOptions = {\r\n args: config.chromeOptions.args,\r\n headless: !config.debug,\r\n };\r\n\r\n if (config.debug)\r\n options.args?.push(`--disable-gpu`, `--remote-debugging-port=${config.ports.frontendDebugging}`);\r\n\r\n browser = await chromium.launch(options);\r\n\r\n const webserverEnv = {\r\n CERTA_PORT: `${config.ports.frontend}`, // eslint-disable-line @typescript-eslint/naming-convention\r\n CERTA_PATH: path.join(__dirname, \"../../../public/index.html\"), // eslint-disable-line @typescript-eslint/naming-convention\r\n CERTA_PUBLIC_DIRS: JSON.stringify(config.chromeOptions.publicDirs), // eslint-disable-line @typescript-eslint/naming-convention\r\n };\r\n webserverProcess = spawnChildProcess(\"node\", [require.resolve(\"./webserver\")], webserverEnv, true);\r\n\r\n // Don't continue until the webserver is started and listening.\r\n const webserverExited = new Promise<never>((_resolve, reject) => webserverProcess.once(\"exit\", () => reject(new Error(\"Webserver exited!\"))));\r\n const webserverStarted = new Promise<number>((resolve) => webserverProcess.once(\"message\", resolve));\r\n const actualPort = await Promise.race([webserverExited, webserverStarted]);\r\n if (actualPort !== config.ports.frontend)\r\n console.warn(`CERTA: Port ${config.ports.frontend} was already in use, so serving test resources on port ${actualPort}`);\r\n process.env.CERTA_PORT = String(actualPort);\r\n }\r\n\r\n public static async runTests(config: CertaConfig): Promise<void> {\r\n // FIXME: Do we really want to always enforce this behavior?\r\n if (process.env.CI || process.env.TF_BUILD)\r\n (config.mochaOptions as any).forbidOnly = true;\r\n\r\n const { failures, coverage } = await runTestsInPlaywright(config, process.env.CERTA_PORT!);\r\n webserverProcess.kill();\r\n\r\n // Save nyc/istanbul coverage file.\r\n if (config.cover)\r\n writeCoverageData(coverage);\r\n\r\n process.exitCode = failures;\r\n }\r\n}\r\n\r\nasync function loadScript(page: Page, scriptPath: string) {\r\n return page.addScriptTag({ url: `/@/${scriptPath}` });\r\n}\r\n\r\nasync function runTestsInPlaywright(config: CertaConfig, port: string) {\r\n return new Promise<ChromeTestResults>(async (resolve, reject) => {\r\n try {\r\n const page = browser.contexts().pop()?.pages()?.pop() || await browser.newPage();\r\n\r\n // Don't let dialogs block tests\r\n page.on(\"dialog\", async (dialog: any) => dialog.dismiss());\r\n\r\n // Re-throw any uncaught exceptions from the frontend in the backend\r\n page.on(\"pageerror\", reject);\r\n\r\n // Expose some functions to the frontend that will execute _in the backend context_\r\n await page.exposeFunction(\"_CertaConsole\", (type: ConsoleMethodName, args: any[]) => console[type](...args));\r\n await page.exposeFunction(\"_CertaSendToBackend\", executeRegisteredCallback);\r\n await page.exposeFunction(\"_CertaReportResults\", (results: ChromeTestResults) => {\r\n setTimeout(async () => {\r\n await browser.close();\r\n resolve(results);\r\n });\r\n });\r\n\r\n // Now load the page (and requisite scripts)...\r\n const testBundle = (config.cover && config.instrumentedTestBundle) || config.testBundle;\r\n await page.goto(`http://localhost:${port}`);\r\n await page.addScriptTag({ content: `var _CERTA_CONFIG = ${JSON.stringify(config)};` });\r\n await loadScript(page, require.resolve(\"../../utils/initLogging.js\"));\r\n await loadScript(page, require.resolve(\"mocha/mocha.js\"));\r\n await loadScript(page, require.resolve(\"source-map-support/browser-source-map-support.js\"));\r\n await loadScript(page, require.resolve(\"../../utils/initSourceMaps.js\"));\r\n await loadScript(page, require.resolve(\"./MochaSerializer.js\"));\r\n await configureRemoteReporter(page);\r\n await loadScript(page, require.resolve(\"../../utils/initMocha.js\"));\r\n await loadScript(page, testBundle);\r\n\r\n // ...and start the tests\r\n await page.evaluate(async () => {\r\n // NB: This is being evaluated in the frontend context!\r\n Mocha.reporters.Base.color = true as any;\r\n const globals = window as any;\r\n mocha.run((failures) => {\r\n const coverage = globals.__coverage__;\r\n globals._CertaReportResults({ failures, coverage }); // This will close the browser\r\n });\r\n });\r\n } catch (error) {\r\n reject(error); // eslint-disable-line @typescript-eslint/prefer-promise-reject-errors\r\n }\r\n });\r\n}\r\n"]}
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
5
5
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
6
6
|
*--------------------------------------------------------------------------------------------*/
|
|
7
|
-
/* eslint-disable @typescript-eslint/naming-convention */
|
|
8
7
|
const detect = require("detect-port");
|
|
9
8
|
const express = require("express");
|
|
10
9
|
const http = require("http");
|
|
@@ -32,7 +31,7 @@ app.use("/@/", (_req, resp) => {
|
|
|
32
31
|
const fullPath = path.resolve("/", filePath);
|
|
33
32
|
resp.sendFile(canonicalPath.normalize(fullPath), {
|
|
34
33
|
headers: (sourceMap) && {
|
|
35
|
-
"X-SourceMap": `/@/${sourceMap.url}`,
|
|
34
|
+
"X-SourceMap": `/@/${sourceMap.url}`,
|
|
36
35
|
},
|
|
37
36
|
});
|
|
38
37
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webserver.js","sourceRoot":"","sources":["../../../src/runners/chrome/webserver.ts"],"names":[],"mappings":";;AAAA;;;+FAG+F;AAC/F,
|
|
1
|
+
{"version":3,"file":"webserver.js","sourceRoot":"","sources":["../../../src/runners/chrome/webserver.ts"],"names":[],"mappings":";;AAAA;;;+FAG+F;AAC/F,sCAAsC;AACtC,mCAAmC;AACnC,6BAA6B;AAC7B,6BAA6B;AAE7B,MAAM,GAAG,GAAG,OAAO,EAAE,CAAC;AAEtB,2BAA2B;AAC3B,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;IAChC,GAAG,CAAC,MAAM,CAAC,6BAA6B,EAAE,GAAG,CAAC,CAAC;IAC/C,GAAG,CAAC,MAAM,CAAC,8BAA8B,EAAE,oBAAoB,CAAC,CAAC;IACjE,GAAG,CAAC,MAAM,CAAC,8BAA8B,EAAE,qLAAqL,CAAC,CAAC;IAClO,IAAI,EAAE,CAAC;AACT,CAAC,CAAC,CAAC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1B,MAAM,CAAC,KAAK,EAAE,CAAC;QACf,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,oBAAoB;AACpB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nimport * as detect from \"detect-port\";\r\nimport * as express from \"express\";\r\nimport * as http from \"http\";\r\nimport * as path from \"path\";\r\n\r\nconst app = express();\r\n\r\n// Enable CORS for all apis\r\napp.all(\"/*\", (_req, res, next) => {\r\n res.header(\"Access-Control-Allow-Origin\", \"*\");\r\n res.header(\"Access-Control-Allow-Methods\", \"POST, GET, OPTIONS\");\r\n res.header(\"Access-Control-Allow-Headers\", \"Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With, X-Correlation-Id, X-Session-Id, X-Application-Id, X-Application-Version, X-User-Id, X-Protocol-Version\");\r\n next();\r\n});\r\n\r\n// The generated HTML file should be served at the \"root\" URL (i.e., http://localhost:3000/).\r\napp.use(\"/\", (req, resp, next) => {\r\n if (req.path === \"/\")\r\n resp.sendFile(process.env.CERTA_PATH!);\r\n else\r\n next();\r\n});\r\n\r\n// Handle a special route for serving absolute paths and files from node_modules\r\napp.use(\"/@/\", (_req, resp) => {\r\n const filePath = _req.originalUrl.replace(/^\\/@\\//, \"\");\r\n const canonicalPath = require(\"canonical-path\");\r\n const sourceMap = require(\"source-map-support\").retrieveSourceMap(filePath);\r\n const fullPath = path.resolve(\"/\", filePath);\r\n resp.sendFile(canonicalPath.normalize(fullPath), {\r\n headers: (sourceMap) && {\r\n \"X-SourceMap\": `/@/${sourceMap.url}`,\r\n },\r\n });\r\n});\r\n\r\n// Serve static assets from any configured \"public\" directories\r\nconst publicDirs: string[] = JSON.parse(process.env.CERTA_PUBLIC_DIRS || \"[]\");\r\nfor (const publicDir of publicDirs) {\r\n app.use(express.static(publicDir));\r\n}\r\n\r\n// All other routes should log a warning\r\nconst alreadyLogged = new Set<string>();\r\napp.use(\"*\", (req, resp) => {\r\n // Don't repeat these warnings if the same asset was requested multiple times.\r\n if (!alreadyLogged.has(req.originalUrl)) {\r\n console.warn(`WARNING: Tests attempted to load missing asset: \"${req.originalUrl}\"`);\r\n alreadyLogged.add(req.originalUrl);\r\n }\r\n resp.sendStatus(404);\r\n});\r\n\r\n// Once the server actually starts, we should log and send the actual port back to the parent process\r\nlet port = parseInt(process.env.CERTA_PORT ?? \"3000\", 10);\r\nconst server = http.createServer(app);\r\nserver.on(\"listening\", async () => {\r\n console.log(`Certa web frontend now listening on port ${port}`);\r\n process.send!(port);\r\n});\r\n\r\n// The preferred port (process.env.CERTA_PORT) may be in use. If that happens detect a free port and try again.\r\n// Even though we detect a free port, there can still be race conditions when many certa processes run simultaneously.\r\n// Therefore, we'll retry up to 4 times with a new free port.\r\nconst maxRetries = 4;\r\nlet numRetries = 0;\r\nserver.on(\"error\", async (e: any) => {\r\n if (e.code !== \"EADDRINUSE\" || numRetries >= maxRetries) {\r\n console.error(e);\r\n process.exit(1);\r\n }\r\n try {\r\n numRetries++;\r\n port = await detect(port);\r\n server.close();\r\n server.listen(port);\r\n } catch (error) {\r\n console.error(error);\r\n process.exit(1);\r\n }\r\n});\r\n\r\n// Run the server...\r\nserver.listen(port);\r\n"]}
|
|
@@ -18,11 +18,11 @@ class ElectronTestRunner {
|
|
|
18
18
|
const { app } = require("electron");
|
|
19
19
|
if (config.debug)
|
|
20
20
|
app.commandLine.appendSwitch("remote-debugging-port", String(config.ports.frontendDebugging));
|
|
21
|
-
const timeout = new Promise((_resolve, reject) => setTimeout(() => reject("Timed out after 2 minutes when starting electron"), 2 * 60 * 1000));
|
|
21
|
+
const timeout = new Promise((_resolve, reject) => setTimeout(() => reject(new Error("Timed out after 2 minutes when starting electron")), 2 * 60 * 1000));
|
|
22
22
|
await Promise.race([app.whenReady(), timeout]);
|
|
23
23
|
}
|
|
24
24
|
static async runTests(config) {
|
|
25
|
-
const { BrowserWindow, app, ipcMain } = require("electron");
|
|
25
|
+
const { BrowserWindow, app, ipcMain } = require("electron");
|
|
26
26
|
const webPreferences = {
|
|
27
27
|
nodeIntegration: true,
|
|
28
28
|
contextIsolation: false,
|
|
@@ -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,kDAAkD,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":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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":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/* eslint-disable @typescript-eslint/naming-convention */\r\nimport * as path from \"path\";\r\nimport { WebPreferences } from \"electron\";\r\nimport { executeRegisteredCallback } from \"../../utils/CallbackUtils\";\r\nimport { relaunchInElectron } from \"../../utils/SpawnUtils\";\r\nimport { CertaConfig } from \"../../CertaConfig\";\r\n\r\nexport class ElectronTestRunner {\r\n public static readonly supportsCoverage = false;\r\n public static readonly supportsCleanup = false;\r\n public static async initialize(config: CertaConfig): Promise<void> {\r\n // Restart under electron if we're running in node\r\n if (!(\"electron\" in process.versions))\r\n return process.exit(await relaunchInElectron());\r\n\r\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.\r\n const { app } = require(\"electron\");\r\n if (config.debug)\r\n app.commandLine.appendSwitch(\"remote-debugging-port\", String(config.ports.frontendDebugging));\r\n\r\n const timeout = new Promise((_resolve, reject) => setTimeout(() => reject(new Error(\"Timed out after 2 minutes when starting electron\")), 2 * 60 * 1000));\r\n await Promise.race([app.whenReady(), timeout]);\r\n }\r\n\r\n public static async runTests(config: CertaConfig): Promise<void> {\r\n const { BrowserWindow, app, ipcMain } = require(\"electron\");\r\n\r\n const webPreferences: WebPreferences = {\r\n nodeIntegration: true,\r\n contextIsolation: false,\r\n sandbox: false,\r\n };\r\n\r\n const rendererWindow = new BrowserWindow({\r\n show: config.debug,\r\n webPreferences,\r\n });\r\n\r\n const exitElectronApp = (exitCode: number) => {\r\n // Passing exit code to parent process doesn't seem to work anymore with electron 10 - sending message with status instead\r\n // See note in SpawnUtils.onExitElectronApp\r\n if (process.send)\r\n process.send({ exitCode });\r\n app.exit(exitCode);\r\n };\r\n\r\n ipcMain.on(\"certa-console\", async (e: any, op: \"log\" | \"error\" | \"dir\", ...args: any[]) => {\r\n console[op](...args);\r\n e.returnValue = undefined; // ipcRenderer.sendSync() will hang without this\r\n });\r\n\r\n ipcMain.on(\"certa-done\", (_e: any, count: number) => {\r\n rendererWindow.webContents.once(\"destroyed\", () => {\r\n exitElectronApp(count);\r\n });\r\n setImmediate(() => rendererWindow.close());\r\n });\r\n\r\n ipcMain.on(\"certa-error\", (_e: any, { message, stack }: any) => {\r\n console.error(\"Uncaught Error in Tests: \", message);\r\n console.error(stack);\r\n rendererWindow.webContents.once(\"destroyed\", () => {\r\n exitElectronApp(1);\r\n });\r\n rendererWindow.close();\r\n });\r\n\r\n ipcMain.on(\"certa-callback\", async (event: any, msg: any) => {\r\n event.returnValue = await executeRegisteredCallback(msg.name, msg.args);\r\n });\r\n\r\n rendererWindow.webContents.once(\"did-finish-load\", async () => {\r\n const initScriptPath = require.resolve(\"./initElectronTests.js\");\r\n const startTests = async () => rendererWindow.webContents.executeJavaScript(`\r\n var _CERTA_CONFIG = ${JSON.stringify(config)};\r\n require(${JSON.stringify(initScriptPath)});\r\n startCertaTests(${JSON.stringify(config.testBundle)});`);\r\n\r\n await startTests();\r\n });\r\n await rendererWindow.loadFile(path.join(__dirname, \"../../../public/index.html\"));\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initMocha.js","sourceRoot":"","sources":["../../src/utils/initMocha.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F,iHAAiH;AAKjH,CAAC,CAAC,MAAmB,EAAE,EAAE;IACvB,MAAM,SAAS,GAAG,MAAM,CAAC,YAAY,CAAC;IAEtC,iHAAiH;IACjH,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;IAChB,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IAEhG,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,QAAQ,EAAE,SAAS,CAAC,eAAe,CAAC,CAAC;IAC9D,6CAA6C;IAC5C,KAAa,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC3B,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACjC,IAAI,SAAS,CAAC,KAAK;QACjB,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC/B,IAAI,SAAS,CAAC,IAAI;QAChB,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAC7B,IAAI,SAAS,CAAC,MAAM;QAClB,KAAK,CAAC,MAAM,EAAE,CAAC;IACjB,IAAI,SAAS,CAAC,UAAU;QACtB,KAAK,CAAC,UAAU,EAAE,CAAC;IAErB,mCAAmC;IACnC,IAAI,MAAM,CAAC,KAAK;QACd,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AACrB,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n// NB: This file is not a CommonJs module - it needs to run in the browser. Do not import or export modules here!\r\n\r\ntype CertaConfig = import(\"../CertaConfig\").CertaConfig;\r\ndeclare let _CERTA_CONFIG: CertaConfig
|
|
1
|
+
{"version":3,"file":"initMocha.js","sourceRoot":"","sources":["../../src/utils/initMocha.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F,iHAAiH;AAKjH,CAAC,CAAC,MAAmB,EAAE,EAAE;IACvB,MAAM,SAAS,GAAG,MAAM,CAAC,YAAY,CAAC;IAEtC,iHAAiH;IACjH,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;IAChB,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IAEhG,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,QAAQ,EAAE,SAAS,CAAC,eAAe,CAAC,CAAC;IAC9D,6CAA6C;IAC5C,KAAa,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC3B,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACjC,IAAI,SAAS,CAAC,KAAK;QACjB,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC/B,IAAI,SAAS,CAAC,IAAI;QAChB,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAC7B,IAAI,SAAS,CAAC,MAAM;QAClB,KAAK,CAAC,MAAM,EAAE,CAAC;IACjB,IAAI,SAAS,CAAC,UAAU;QACtB,KAAK,CAAC,UAAU,EAAE,CAAC;IAErB,mCAAmC;IACnC,IAAI,MAAM,CAAC,KAAK;QACd,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AACrB,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n// NB: This file is not a CommonJs module - it needs to run in the browser. Do not import or export modules here!\r\n\r\ntype CertaConfig = import(\"../CertaConfig\").CertaConfig;\r\ndeclare let _CERTA_CONFIG: CertaConfig;\r\n\r\n((config: CertaConfig) => {\r\n const mochaOpts = config.mochaOptions;\r\n\r\n // This is essentially equivalent to `mocha.setup(\"bdd\")`, except it works in both node and browser environments.\r\n mocha.ui(\"bdd\");\r\n mocha.suite.emit(\"pre-require\", typeof (window) === \"undefined\" ? global : window, null, mocha);\r\n\r\n mocha.reporter(mochaOpts.reporter, mochaOpts.reporterOptions);\r\n // TODO: Come back and fix useColors to color\r\n (mocha as any).color(true);\r\n mocha.timeout(mochaOpts.timeout);\r\n if (mochaOpts.fgrep)\r\n mocha.fgrep(mochaOpts.fgrep);\r\n if (mochaOpts.grep)\r\n mocha.grep(mochaOpts.grep);\r\n if (mochaOpts.invert)\r\n mocha.invert();\r\n if (mochaOpts.forbidOnly)\r\n mocha.forbidOnly();\r\n\r\n // Disable timeouts when debugging.\r\n if (config.debug)\r\n mocha.timeout(0);\r\n})(_CERTA_CONFIG);\r\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/certa",
|
|
3
|
-
"version": "4.10.0-dev.
|
|
3
|
+
"version": "4.10.0-dev.34",
|
|
4
4
|
"description": "A mocha-based integration test runner",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "bin/certa.js",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"yargs": "^17.4.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@itwin/eslint-plugin": "
|
|
37
|
+
"@itwin/eslint-plugin": "5.0.0-dev.1",
|
|
38
38
|
"@types/chai": "4.3.1",
|
|
39
39
|
"@types/detect-port": "~1.1.0",
|
|
40
40
|
"@types/express": "^4.17.20",
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
"@types/node": "~18.16.20",
|
|
44
44
|
"@types/yargs": "17.0.19",
|
|
45
45
|
"electron": "^33.0.0",
|
|
46
|
-
"eslint": "^
|
|
46
|
+
"eslint": "^9.13.0",
|
|
47
47
|
"nyc": "^15.1.0",
|
|
48
48
|
"rimraf": "^3.0.2",
|
|
49
49
|
"typescript": "~5.6.2",
|
|
50
|
-
"@itwin/build-tools": "4.10.0-dev.
|
|
50
|
+
"@itwin/build-tools": "4.10.0-dev.34"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"electron": ">=23.0.0 <34.0.0"
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"scripts": {
|
|
61
61
|
"build": "tsc 1>&2",
|
|
62
62
|
"clean": "rimraf lib .rush/temp/package-deps*.json",
|
|
63
|
-
"lint": "eslint
|
|
63
|
+
"lint": "eslint \"./src/**/*.ts\" 1>&2",
|
|
64
64
|
"test": "",
|
|
65
65
|
"docs": "",
|
|
66
66
|
"cover": "",
|