@japa/runner 3.0.5 → 3.1.1

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.
@@ -83,7 +83,7 @@ var SpecReporter = class extends BaseReporter {
83
83
  * Returns the test message
84
84
  */
85
85
  #getTestMessage(payload) {
86
- const message = typeof payload.title === "string" ? payload.title : payload.title.expanded;
86
+ const message = payload.title.expanded;
87
87
  if (payload.isTodo) {
88
88
  return colors.blue(message);
89
89
  }
@@ -281,4 +281,4 @@ export {
281
281
  dot,
282
282
  ndjson
283
283
  };
284
- //# sourceMappingURL=chunk-52OY4QRJ.js.map
284
+ //# sourceMappingURL=chunk-6IZE72CL.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/helpers.ts","../src/reporters/dot.ts","../src/reporters/spec.ts","../src/reporters/ndjson.ts","../src/reporters/main.ts"],"sourcesContent":["/*\n * @japa/runner\n *\n * (c) Japa\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport useColors from '@poppinss/colors'\nimport { Colors } from '@poppinss/colors/types'\n\nexport const colors: Colors = useColors.ansi()\n\n/**\n * A collection of platform specific icons\n */\nexport const icons =\n process.platform === 'win32' && !process.env.WT_SESSION\n ? {\n tick: '√',\n cross: '×',\n bullet: '*',\n nodejs: '♦',\n pointer: '>',\n info: 'i',\n warning: '‼',\n squareSmallFilled: '[█]',\n }\n : {\n tick: '✔',\n cross: '✖',\n bullet: '●',\n nodejs: '⬢',\n pointer: '❯',\n info: 'ℹ',\n warning: '⚠',\n squareSmallFilled: '◼',\n }\n","/*\n * @japa/runner\n *\n * (c) Japa\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport { colors, icons } from '../helpers.js'\nimport type { TestEndNode } from '../../modules/core/types.js'\nimport { BaseReporter } from '../../modules/core/reporters/base.js'\n\n/**\n * Minimal reporter that prints each test as an icon.\n */\nexport class DotReporter extends BaseReporter {\n /**\n * When a test ended\n */\n protected onTestEnd(payload: TestEndNode) {\n let output = ''\n if (payload.isTodo) {\n output = colors.cyan(icons.info)\n } else if (payload.hasError || payload.isFailing) {\n output = payload.hasError ? colors.magenta(icons.squareSmallFilled) : colors.red(icons.cross)\n } else if (payload.isSkipped) {\n output = colors.yellow(icons.bullet)\n } else {\n output = colors.green(icons.tick)\n }\n\n process.stdout.write(`${output}`)\n }\n\n /**\n * When test runner ended\n */\n protected async end() {\n console.log('')\n await this.printSummary(this.runner!.getSummary())\n }\n}\n","/*\n * @japa/runner\n *\n * (c) Japa\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport ms from 'ms'\nimport { relative } from 'node:path'\n\nimport { colors, icons } from '../helpers.js'\nimport { BaseReporter } from '../../modules/core/main.js'\nimport { GroupStartNode, TestEndNode } from '../../modules/core/types.js'\n\n/**\n * Pretty prints the tests on the console\n */\nexport class SpecReporter extends BaseReporter {\n /**\n * Tracking if the first event we get is for a test without any parent group\n * We need this to decide the display style for tests without groups.\n */\n #isFirstLoneTest = true\n\n /**\n * Returns the icon for the test\n */\n #getTestIcon(payload: TestEndNode) {\n if (payload.isTodo) {\n return colors.cyan(icons.info)\n }\n\n if (payload.isFailing) {\n return payload.hasError ? colors.magenta(icons.squareSmallFilled) : colors.red(icons.cross)\n }\n\n if (payload.hasError) {\n return colors.red(icons.cross)\n }\n\n if (payload.isSkipped) {\n return colors.yellow(icons.bullet)\n }\n\n return colors.green(icons.tick)\n }\n\n /**\n * Returns the test message\n */\n #getTestMessage(payload: TestEndNode) {\n const message = payload.title.expanded\n\n if (payload.isTodo) {\n return colors.blue(message)\n }\n\n if (payload.isFailing) {\n return payload.hasError ? colors.magenta(message) : colors.red(message)\n }\n\n if (payload.hasError) {\n return colors.red(message)\n }\n\n if (payload.isSkipped) {\n return colors.yellow(message)\n }\n\n return colors.grey(message)\n }\n\n /**\n * Returns the subtext message for the test\n */\n #getSubText(payload: TestEndNode): string | undefined {\n if (payload.isSkipped && payload.skipReason) {\n return colors.yellow(payload.skipReason)\n }\n\n if (!payload.isFailing) {\n return\n }\n\n if (!payload.hasError) {\n return colors.magenta(`Test marked with \".fails()\" must finish with an error`)\n }\n\n if (payload.failReason) {\n return colors.magenta(payload.failReason)\n }\n\n const testErrorMessage = payload.errors.find((error) => error.phase === 'test')\n if (testErrorMessage && testErrorMessage.error) {\n return colors.magenta(testErrorMessage.error.message)\n }\n }\n\n /**\n * Returns the filename relative from the current working dir\n */\n #getRelativeFilename(fileName: string) {\n return relative(process.cwd(), fileName)\n }\n\n /**\n * Prints the test details\n */\n #printTest(payload: TestEndNode) {\n const icon = this.#getTestIcon(payload)\n const message = this.#getTestMessage(payload)\n const prefix = payload.isPinned ? colors.yellow('[PINNED] ') : ''\n const indentation = this.currentFileName || this.currentGroupName ? ' ' : ''\n const duration = colors.dim(`(${ms(Number(payload.duration.toFixed(2)))})`)\n const retries =\n payload.retryAttempt && payload.retryAttempt > 1\n ? colors.dim(`(x${payload.retryAttempt}) `)\n : ''\n\n let subText = this.#getSubText(payload)\n subText = subText ? `\\n${indentation} ${subText}` : ''\n\n console.log(`${indentation}${icon} ${prefix}${retries}${message} ${duration}${subText}`)\n }\n\n /**\n * Prints the group name\n */\n #printGroup(payload: GroupStartNode) {\n const title =\n this.currentSuiteName !== 'default'\n ? `${this.currentSuiteName} / ${payload.title}`\n : payload.title\n\n const suffix = this.currentFileName\n ? colors.dim(` (${this.#getRelativeFilename(this.currentFileName)})`)\n : ''\n\n console.log(`\\n${title}${suffix}`)\n }\n\n protected onTestStart(): void {\n /**\n * Display the filename when\n *\n * - The filename exists\n * - The test is not under a group\n * - Test is first in a sequence\n */\n if (this.currentFileName && this.#isFirstLoneTest) {\n console.log(`\\n${colors.dim(this.#getRelativeFilename(this.currentFileName))}`)\n }\n this.#isFirstLoneTest = false\n }\n\n protected onTestEnd(payload: TestEndNode): void {\n this.#printTest(payload)\n }\n\n protected onGroupStart(payload: GroupStartNode): void {\n /**\n * When a group starts, we mark the upcoming test as NOT a\n * lone test\n */\n this.#isFirstLoneTest = false\n this.#printGroup(payload)\n }\n\n protected onGroupEnd(): void {\n /**\n * When the group ends we assume that the next test can\n * be out of the group, hence a lone test.\n *\n * If this assumption is false, then the `onGroupStart` method\n * will toggle the boolean\n */\n this.#isFirstLoneTest = true\n }\n\n protected async end() {\n const summary = this.runner!.getSummary()\n await this.printSummary(summary)\n }\n}\n","/*\n * @japa/runner\n *\n * (c) Japa\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport { relative } from 'node:path'\nimport { serializeError } from 'serialize-error'\n\nimport { BaseReporter } from '../../modules/core/main.js'\nimport type {\n TestEndNode,\n SuiteEndNode,\n GroupEndNode,\n SuiteStartNode,\n GroupStartNode,\n} from '../../modules/core/types.js'\n\n/**\n * Prints tests progress as JSON. Each event is emitted\n * independently\n */\nexport class NdJSONReporter extends BaseReporter {\n /**\n * Returns the filename relative from the current working dir\n */\n #getRelativeFilename(fileName: string) {\n return relative(process.cwd(), fileName)\n }\n\n /**\n * Serialize errors to JSON\n */\n #serializeErrors(errors: TestEndNode['errors']) {\n return errors.map((error) => ({\n phase: error.phase,\n error: serializeError(error.error),\n }))\n }\n\n protected onTestEnd(payload: TestEndNode): void {\n console.log(\n JSON.stringify({\n event: 'test:end',\n filePath: this.currentFileName,\n relativePath: this.currentFileName\n ? this.#getRelativeFilename(this.currentFileName)\n : undefined,\n title: payload.title,\n duration: payload.duration,\n failReason: payload.failReason,\n isFailing: payload.isFailing,\n skipReason: payload.skipReason,\n isSkipped: payload.isSkipped,\n isTodo: payload.isTodo,\n isPinned: payload.isPinned,\n retryAttempt: payload.retryAttempt,\n retries: payload.retries,\n errors: this.#serializeErrors(payload.errors),\n })\n )\n }\n\n protected onGroupStart(payload: GroupStartNode): void {\n console.log(\n JSON.stringify({\n event: 'group:start',\n title: payload.title,\n })\n )\n }\n\n protected onGroupEnd(payload: GroupEndNode): void {\n JSON.stringify({\n event: 'group:end',\n title: payload.title,\n errors: this.#serializeErrors(payload.errors),\n })\n }\n\n protected onSuiteStart(payload: SuiteStartNode): void {\n console.log(\n JSON.stringify({\n event: 'suite:start',\n ...payload,\n })\n )\n }\n\n protected onSuiteEnd(payload: SuiteEndNode): void {\n console.log(\n JSON.stringify({\n event: 'suite:end',\n ...payload,\n })\n )\n }\n\n protected async end() {\n const summary = this.runner!.getSummary()\n console.log(\n JSON.stringify({\n aggregates: summary.aggregates,\n duration: summary.duration,\n failedTestsTitles: summary.failedTestsTitles,\n hasError: summary.hasError,\n })\n )\n }\n}\n","/*\n * @japa/runner\n *\n * (c) Japa\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport { DotReporter } from './dot.js'\nimport { SpecReporter } from './spec.js'\nimport { NdJSONReporter } from './ndjson.js'\nimport type { BaseReporterOptions, NamedReporterContract } from '../types.js'\n\n/**\n * Create an instance of the spec reporter\n */\nexport const spec: (options?: BaseReporterOptions) => NamedReporterContract = (options) => {\n return {\n name: 'spec',\n handler: (...args) => new SpecReporter(options).boot(...args),\n }\n}\n\n/**\n * Create an instance of the dot reporter\n */\nexport const dot: (options?: BaseReporterOptions) => NamedReporterContract = (options) => {\n return {\n name: 'dot',\n handler: (...args) => new DotReporter(options).boot(...args),\n }\n}\n\n/**\n * Create an instance of the ndjson reporter\n */\nexport const ndjson: (options?: BaseReporterOptions) => NamedReporterContract = (options) => {\n return {\n name: 'ndjson',\n handler: (...args) => new NdJSONReporter(options).boot(...args),\n }\n}\n"],"mappings":";;;;;AASA,OAAO,eAAe;AAGf,IAAM,SAAiB,UAAU,KAAK;AAKtC,IAAM,QACX,QAAQ,aAAa,WAAW,CAAC,QAAQ,IAAI,aACzC;AAAA,EACE,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,MAAM;AAAA,EACN,SAAS;AAAA,EACT,mBAAmB;AACrB,IACA;AAAA,EACE,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MAAM;AAAA,IAC9C,CAAC;AAAA,EACH;AAAA,EAEU,aAAa,SAA+B;AACpD,YAAQ;AAAA,MACN,KAAK,UAAU;AAAA,QACb,OAAO;AAAA,QACP,GAAG;AAAA,MACL,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEU,WAAW,SAA6B;AAChD,YAAQ;AAAA,MACN,KAAK,UAAU;AAAA,QACb,OAAO;AAAA,QACP,GAAG;AAAA,MACL,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,MAAgB,MAAM;AACpB,UAAM,UAAU,KAAK,OAAQ,WAAW;AACxC,YAAQ;AAAA,MACN,KAAK,UAAU;AAAA,QACb,YAAY,QAAQ;AAAA,QACpB,UAAU,QAAQ;AAAA,QAClB,mBAAmB,QAAQ;AAAA,QAC3B,UAAU,QAAQ;AAAA,MACpB,CAAC;AAAA,IACH;AAAA,EACF;AACF;;;AC/FO,IAAM,OAAiE,CAAC,YAAY;AACzF,SAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS,IAAI,SAAS,IAAI,aAAa,OAAO,EAAE,KAAK,GAAG,IAAI;AAAA,EAC9D;AACF;AAKO,IAAM,MAAgE,CAAC,YAAY;AACxF,SAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS,IAAI,SAAS,IAAI,YAAY,OAAO,EAAE,KAAK,GAAG,IAAI;AAAA,EAC7D;AACF;AAKO,IAAM,SAAmE,CAAC,YAAY;AAC3F,SAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS,IAAI,SAAS,IAAI,eAAe,OAAO,EAAE,KAAK,GAAG,IAAI;AAAA,EAChE;AACF;","names":["relative","relative"]}
@@ -15,4 +15,4 @@ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "defau
15
15
  export {
16
16
  __reExport
17
17
  };
18
- //# sourceMappingURL=chunk-MWYEWO7K.js.map
18
+ //# sourceMappingURL=chunk-OBDV3O36.js.map
@@ -2,7 +2,7 @@ import {
2
2
  dot,
3
3
  ndjson,
4
4
  spec
5
- } from "./chunk-52OY4QRJ.js";
5
+ } from "./chunk-6IZE72CL.js";
6
6
  import {
7
7
  Group,
8
8
  Refiner,
@@ -96,12 +96,13 @@ var FilesManager = class {
96
96
  * Returns a collection of files from the user defined
97
97
  * glob or the implementation function
98
98
  */
99
- async getFiles(cwd, files) {
99
+ async getFiles(cwd, files, excludes) {
100
100
  if (Array.isArray(files) || typeof files === "string") {
101
101
  const testFiles = await fastGlob(files, {
102
102
  absolute: true,
103
103
  onlyFiles: true,
104
- cwd
104
+ cwd,
105
+ ignore: excludes
105
106
  });
106
107
  return testFiles.map((file) => pathToFileURL(file));
107
108
  }
@@ -153,7 +154,7 @@ var Planner = class {
153
154
  * files glob and apply the files filter
154
155
  */
155
156
  async #collectFiles(files) {
156
- let filesURLs = await this.#fileManager.getFiles(this.#config.cwd, files);
157
+ let filesURLs = await this.#fileManager.getFiles(this.#config.cwd, files, this.#config.exclude);
157
158
  if (this.#config.filters.files && this.#config.filters.files.length) {
158
159
  filesURLs = this.#fileManager.grep(filesURLs, this.#config.filters.files);
159
160
  }
@@ -340,8 +341,8 @@ var ConfigManager = class {
340
341
  * Processes a CLI argument and converts it to an
341
342
  * array of strings
342
343
  */
343
- #processAsArray(value) {
344
- return Array.isArray(value) ? value : value.split(",").map((item) => item.trim());
344
+ #processAsArray(value, splitByComma) {
345
+ return Array.isArray(value) ? value : splitByComma ? value.split(",").map((item) => item.trim()) : [value];
345
346
  }
346
347
  /**
347
348
  * Returns a copy of filters based upon the CLI
@@ -350,19 +351,19 @@ var ConfigManager = class {
350
351
  #getCLIFilters() {
351
352
  const filters = {};
352
353
  if (this.#cliArgs.tags) {
353
- filters.tags = this.#processAsArray(this.#cliArgs.tags);
354
+ filters.tags = this.#processAsArray(this.#cliArgs.tags, true);
354
355
  }
355
356
  if (this.#cliArgs.tests) {
356
- filters.tests = this.#processAsArray(this.#cliArgs.tests);
357
+ filters.tests = this.#processAsArray(this.#cliArgs.tests, false);
357
358
  }
358
359
  if (this.#cliArgs.files) {
359
- filters.files = this.#processAsArray(this.#cliArgs.files);
360
+ filters.files = this.#processAsArray(this.#cliArgs.files, true);
360
361
  }
361
362
  if (this.#cliArgs.groups) {
362
- filters.groups = this.#processAsArray(this.#cliArgs.groups);
363
+ filters.groups = this.#processAsArray(this.#cliArgs.groups, false);
363
364
  }
364
365
  if (this.#cliArgs._ && this.#cliArgs._.length) {
365
- filters.suites = this.#processAsArray(this.#cliArgs._);
366
+ filters.suites = this.#processAsArray(this.#cliArgs._, true);
366
367
  }
367
368
  return filters;
368
369
  }
@@ -402,7 +403,7 @@ var ConfigManager = class {
402
403
  */
403
404
  #getCLIReporters() {
404
405
  if (this.#cliArgs.reporters) {
405
- return this.#processAsArray(this.#cliArgs.reporters);
406
+ return this.#processAsArray(this.#cliArgs.reporters, true);
406
407
  }
407
408
  }
408
409
  /**
@@ -418,6 +419,7 @@ var ConfigManager = class {
418
419
  debug_default("filters applied using CLI flags %O", cliFilters);
419
420
  const baseConfig = {
420
421
  cwd: this.#config.cwd ?? process.cwd(),
422
+ exclude: this.#config.exclude || ["node_modules/**", ".git/**", "coverage/**"],
421
423
  filters: Object.assign({}, this.#config.filters ?? {}, cliFilters),
422
424
  importer: this.#config.importer ?? DEFAULTS.importer,
423
425
  refiner: this.#config.refiner ?? new Refiner(),
@@ -500,4 +502,4 @@ export {
500
502
  createTest,
501
503
  createTestGroup
502
504
  };
503
- //# sourceMappingURL=chunk-CXTCA2MO.js.map
505
+ //# sourceMappingURL=chunk-PSL75GNC.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/debug.ts","../src/validator.ts","../src/files_manager.ts","../src/planner.ts","../src/hooks.ts","../src/cli_parser.ts","../src/config_manager.ts","../src/create_test.ts"],"sourcesContent":["/*\n * @japa/runner\n *\n * (c) Japa\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport { debuglog } from 'node:util'\nexport default debuglog('japa:runner')\n","/*\n * @japa/runner\n *\n * (c) Japa\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport { NormalizedConfig } from './types.js'\n\n/**\n * Validator encapsulates the validations to perform before running\n * the tests\n */\nclass Validator {\n /**\n * Ensures the japa is configured. Otherwise raises an exception\n */\n ensureIsConfigured(config: NormalizedConfig | undefined) {\n if (!config) {\n throw new Error(\n `Cannot run tests. Make sure to call \"configure\" method before the \"run\" method`\n )\n }\n }\n\n /**\n * Ensures the japa is in planning phase\n */\n ensureIsInPlanningPhase(phase: 'idle' | 'planning' | 'executing') {\n if (phase !== 'planning') {\n throw new Error(\n `Cannot import japa test file directly. It must be imported by calling the \"japa.run\" method`\n )\n }\n }\n\n /**\n * Ensures the suites filter uses a subset of the user configured suites.\n */\n validateSuitesFilter(config: NormalizedConfig) {\n /**\n * Do not perform any validation if no filters are applied\n * in the first place\n */\n if (!config.filters.suites || !config.filters.suites.length) {\n return\n }\n\n /**\n * Notify user they have applied the suites filter but forgot to define\n * suites\n */\n if (!('suites' in config) || !config.suites.length) {\n throw new Error(`Cannot apply suites filter. You have not configured any test suites`)\n }\n\n const suites = config.suites.map(({ name }) => name)\n\n /**\n * Find unknown suites and report the error\n */\n const unknownSuites = config.filters.suites.filter((suite) => !suites.includes(suite))\n if (unknownSuites.length) {\n throw new Error(`Cannot apply suites filter. \"${unknownSuites[0]}\" suite is not configured`)\n }\n }\n\n /**\n * Ensure there are unique suites\n */\n validateSuitesForUniqueness(config: NormalizedConfig) {\n if (!('suites' in config)) {\n return\n }\n\n const suites: Set<string> = new Set()\n config.suites.forEach(({ name }) => {\n if (suites.has(name)) {\n throw new Error(`Duplicate suite \"${name}\"`)\n }\n suites.add(name)\n })\n\n suites.clear()\n }\n\n /**\n * Ensure the activated reporters are in the list of defined\n * reporters\n */\n validateActivatedReporters(config: NormalizedConfig) {\n const reportersList = config.reporters.list.map(({ name }) => name)\n const unknownReporters = config.reporters.activated.filter(\n (name) => !reportersList.includes(name)\n )\n\n if (unknownReporters.length) {\n throw new Error(\n `Invalid reporter \"${unknownReporters[0]}\". Make sure to register it first inside the \"reporters.list\" array`\n )\n }\n }\n}\n\nexport default new Validator()\n","/*\n * @japa/runner\n *\n * (c) Japa\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport slash from 'slash'\nimport fastGlob from 'fast-glob'\nimport { pathToFileURL } from 'node:url'\nimport type { TestFiles } from './types.js'\n\n/**\n * The expression to remove file extension and optionally\n * .spec|.test from the test file name\n */\nconst FILE_SUFFIX_EXPRESSION = /(\\.spec|\\.test)?\\.[js|ts|jsx|tsx|mjs|mts|cjs|cts]+$/\n\n/**\n * Files manager exposes the API to collect, filter and import test\n * files based upon the config\n */\nexport class FilesManager {\n /**\n * Returns a collection of files from the user defined\n * glob or the implementation function\n */\n async getFiles(cwd: string, files: TestFiles, excludes: string[]): Promise<URL[]> {\n if (Array.isArray(files) || typeof files === 'string') {\n const testFiles = await fastGlob(files, {\n absolute: true,\n onlyFiles: true,\n cwd: cwd,\n ignore: excludes,\n })\n return testFiles.map((file) => pathToFileURL(file))\n }\n\n return await files()\n }\n\n /**\n * Applies file name filter on a collection of file\n * URLs\n */\n grep(files: URL[], filters: string[]): URL[] {\n return files.filter((file) => {\n const filename = slash(file.pathname)\n const filenameWithoutTestSuffix = filename.replace(FILE_SUFFIX_EXPRESSION, '')\n\n return !!filters.find((filter) => {\n if (filename.endsWith(filter)) {\n return true\n }\n\n const filterSegments = filter.split('/').reverse()\n const fileSegments = filenameWithoutTestSuffix.split('/').reverse()\n\n return filterSegments.every((segment, index) => {\n return fileSegments[index] && (segment === '*' || fileSegments[index].endsWith(segment))\n })\n })\n })\n }\n}\n","/*\n * @japa/runner\n *\n * (c) Japa\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport validator from './validator.js'\nimport { FilesManager } from './files_manager.js'\nimport type { NamedReporterContract, NormalizedConfig, TestFiles, TestSuite } from './types.js'\n\n/**\n * The tests planner is used to plan the tests by doing all\n * the heavy lifting of executing plugins, registering\n * reporters, filtering tests and so on.\n */\nexport class Planner {\n #config: NormalizedConfig\n #fileManager = new FilesManager()\n\n constructor(config: NormalizedConfig) {\n validator.validateActivatedReporters(config!)\n validator.validateSuitesFilter(config!)\n validator.validateSuitesForUniqueness(config!)\n this.#config = config\n }\n\n /**\n * Returns a list of reporters based upon the activated\n * reporters list.\n */\n #getActivatedReporters(): NamedReporterContract[] {\n return this.#config.reporters.activated.map((activated) => {\n return this.#config.reporters.list.find(({ name }) => activated === name)!\n })\n }\n\n /**\n * A generic method to collect files from the user defined\n * files glob and apply the files filter\n */\n async #collectFiles(files: TestFiles) {\n let filesURLs = await this.#fileManager.getFiles(this.#config.cwd, files, this.#config.exclude)\n if (this.#config.filters.files && this.#config.filters.files.length) {\n filesURLs = this.#fileManager.grep(filesURLs, this.#config.filters.files)\n }\n\n return filesURLs\n }\n\n /**\n * Returns a collection of suites and their associated\n * test files by applying all the filters\n */\n async #getSuites(): Promise<(TestSuite & { filesURLs: URL[] })[]> {\n let suites: (TestSuite & { filesURLs: URL[] })[] = []\n let suitesFilters = this.#config.filters.suites || []\n\n if ('files' in this.#config) {\n suites.push({\n name: 'default',\n files: this.#config.files,\n timeout: this.#config.timeout,\n retries: this.#config.retries,\n filesURLs: await this.#collectFiles(this.#config.files),\n })\n }\n\n if ('suites' in this.#config) {\n for (let suite of this.#config.suites) {\n if (!suitesFilters.length || suitesFilters.includes(suite.name)) {\n suites.push({\n ...suite,\n filesURLs: await this.#collectFiles(suite.files),\n })\n }\n }\n }\n\n return suites\n }\n\n /**\n * Returns a list of filters to the passed to the refiner\n */\n #getRefinerFilters() {\n return Object.keys(this.#config.filters).reduce(\n (result, layer) => {\n if (layer === 'tests' || layer === 'tags' || layer === 'groups') {\n result.push({ layer, filters: this.#config.filters[layer]! })\n }\n return result\n },\n [] as { layer: 'tags' | 'tests' | 'groups'; filters: string[] }[]\n )\n }\n\n /**\n * Creates a plan for running the tests\n */\n async plan() {\n const suites = await this.#getSuites()\n const reporters = this.#getActivatedReporters()\n const refinerFilters = this.#getRefinerFilters()\n return {\n reporters,\n suites,\n refinerFilters,\n config: this.#config,\n }\n }\n}\n","/*\n * @japa/runner\n *\n * (c) Japa\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport Hooks from '@poppinss/hooks'\nimport type { Runner as HooksRunner } from '@poppinss/hooks/types'\n\nimport { Runner } from '../modules/core/main.js'\nimport type { HooksEvents, SetupHookState, NormalizedConfig, TeardownHookState } from './types.js'\n\n/**\n * Exposes API for working with global hooks\n */\nexport class GlobalHooks {\n #hooks = new Hooks<HooksEvents>()\n #setupRunner: HooksRunner<SetupHookState[0], SetupHookState[1]> | undefined\n #teardownRunner: HooksRunner<TeardownHookState[0], TeardownHookState[1]> | undefined\n\n /**\n * Apply hooks from the config\n */\n apply(config: NormalizedConfig) {\n config.setup.forEach((hook) => this.#hooks.add('setup', hook))\n config.teardown.forEach((hook) => this.#hooks.add('teardown', hook))\n }\n\n /**\n * Perform setup\n */\n async setup(runner: Runner) {\n this.#setupRunner = this.#hooks.runner('setup')\n this.#teardownRunner = this.#hooks.runner('teardown')\n await this.#setupRunner.run(runner)\n }\n\n /**\n * Perform cleanup\n */\n async teardown(error: Error | null, runner: Runner) {\n if (this.#setupRunner) {\n await this.#setupRunner.cleanup(error, runner)\n }\n if (this.#teardownRunner) {\n if (!error) {\n await this.#teardownRunner.run(runner)\n }\n await this.#teardownRunner.cleanup(error, runner)\n }\n }\n}\n","/*\n * @japa/runner\n *\n * (c) Japa\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\n// @ts-ignore-error\nimport getopts from 'getopts'\nimport colors from '@poppinss/colors'\nimport type { CLIArgs } from './types.js'\n\nconst ansi = colors.ansi()\n\n/**\n * Known commandline options. The user can still define additional flags and they\n * will be parsed aswell, but without any normalization\n */\nconst OPTIONS = {\n string: ['tests', 'groups', 'tags', 'files', 'timeout', 'retries', 'reporters', 'failed'],\n boolean: ['help', 'matchAll', 'failed'],\n alias: {\n forceExit: 'force-exit',\n matchAll: 'match-all',\n help: 'h',\n },\n}\n\n/**\n * Help string to display when the `--help flag is used`\n */\nconst GET_HELP = () => `\n${ansi.yellow('@japa/runner v2.3.0')}\n\n${ansi.green('--tests')} ${ansi.dim('Filter tests by the test title')}\n${ansi.green('--groups')} ${ansi.dim('Filter tests by the group title')}\n${ansi.green('--tags')} ${ansi.dim('Filter tests by tags')}\n${ansi.green('--files')} ${ansi.dim('Filter tests by the file name')}\n${ansi.green('--force-exit')} ${ansi.dim('Forcefully exit the process')}\n${ansi.green('--timeout')} ${ansi.dim('Define default timeout for all tests')}\n${ansi.green('--retries')} ${ansi.dim('Define default retries for all tests')}\n${ansi.green('--reporters')} ${ansi.dim('Activate one or more test reporters')}\n${ansi.green('--failed')} ${ansi.dim('Run tests failed during the last run')}\n${ansi.green('-h, --help')} ${ansi.dim('View help')}\n\n${ansi.yellow('Examples:')}\n${ansi.dim('node bin/test.js --tags=\"@github\"')}\n${ansi.dim('node bin/test.js --tags=\"~@github\"')}\n${ansi.dim('node bin/test.js --tags=\"@github,@slow,@integration\" --match-all')}\n${ansi.dim('node bin/test.js --force-exit')}\n${ansi.dim('node bin/test.js --files=\"user\"')}\n${ansi.dim('node bin/test.js --files=\"functional/user\"')}\n${ansi.dim('node bin/test.js --files=\"unit/user\"')}\n\n${ansi.yellow('Notes:')}\n- When groups and tests filters are applied together. We will first filter the\n tests by group title and then apply the tests title filter.\n- The timeout defined on test object takes precedence over the ${ansi.green('--timeout')} flag.\n- The retries defined on test object takes precedence over the ${ansi.green('--retries')} flag.\n- The ${ansi.green('--files')} flag checks for the file names ending with the filter substring.\n`\n\n/**\n * CLI Parser is used to parse the commandline argument\n */\nexport class CliParser {\n /**\n * Parses command-line arguments\n */\n parse(argv: string[]): CLIArgs {\n return getopts(argv, OPTIONS)\n }\n\n /**\n * Returns the help string\n */\n getHelp() {\n return GET_HELP()\n }\n}\n","/*\n * @japa/runner\n *\n * (c) Japa\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport debug from './debug.js'\nimport { Refiner } from '../modules/core/main.js'\nimport { dot, ndjson, spec } from './reporters/main.js'\nimport type { CLIArgs, Config, Filters, NormalizedBaseConfig, NormalizedConfig } from './types.js'\n\nexport const NOOP = () => {}\n\n/**\n * Defaults to use for configuration\n */\nconst DEFAULTS = {\n files: [],\n timeout: 2000,\n retries: 0,\n forceExit: false,\n plugins: [],\n reporters: {\n activated: ['spec'],\n list: [spec(), ndjson(), dot()],\n },\n importer: (filePath) => import(filePath.href),\n configureSuite: () => {},\n} satisfies Config\n\n/**\n * Config manager is used to hydrate the configuration by merging\n * the defaults, user defined config and the command line\n * flags.\n *\n * The command line flags have the upmost priority\n */\nexport class ConfigManager {\n #config: Config\n #cliArgs: CLIArgs\n\n constructor(config: Config, cliArgs: CLIArgs) {\n this.#config = config\n this.#cliArgs = cliArgs\n }\n\n /**\n * Processes a CLI argument and converts it to an\n * array of strings\n */\n #processAsArray(value: string | string[], splitByComma: boolean): string[] {\n return Array.isArray(value)\n ? value\n : splitByComma\n ? value.split(',').map((item: string) => item.trim())\n : [value]\n }\n\n /**\n * Returns a copy of filters based upon the CLI\n * arguments.\n */\n #getCLIFilters(): Filters {\n const filters: Filters = {}\n\n if (this.#cliArgs.tags) {\n filters.tags = this.#processAsArray(this.#cliArgs.tags, true)\n }\n if (this.#cliArgs.tests) {\n filters.tests = this.#processAsArray(this.#cliArgs.tests, false)\n }\n if (this.#cliArgs.files) {\n filters.files = this.#processAsArray(this.#cliArgs.files, true)\n }\n if (this.#cliArgs.groups) {\n filters.groups = this.#processAsArray(this.#cliArgs.groups, false)\n }\n if (this.#cliArgs._ && this.#cliArgs._.length) {\n filters.suites = this.#processAsArray(this.#cliArgs._, true)\n }\n\n return filters\n }\n\n /**\n * Returns the timeout from the CLI args\n */\n #getCLITimeout(): number | undefined {\n if (this.#cliArgs.timeout) {\n const value = Number(this.#cliArgs.timeout)\n if (!Number.isNaN(value)) {\n return value\n }\n }\n }\n\n /**\n * Returns the retries from the CLI args\n */\n #getCLIRetries(): number | undefined {\n if (this.#cliArgs.retries) {\n const value = Number(this.#cliArgs.retries)\n if (!Number.isNaN(value)) {\n return value\n }\n }\n }\n\n /**\n * Returns the forceExit property from the CLI args\n */\n #getCLIForceExit(): boolean | undefined {\n if (this.#cliArgs.forceExit) {\n return true\n }\n }\n\n /**\n * Returns reporters selected using the commandline\n * --reporter flag\n */\n #getCLIReporters(): string[] | undefined {\n if (this.#cliArgs.reporters) {\n return this.#processAsArray(this.#cliArgs.reporters, true)\n }\n }\n\n /**\n * Hydrates the config with user defined options and the\n * command-line flags.\n */\n hydrate(): NormalizedConfig {\n const cliFilters = this.#getCLIFilters()\n const cliRetries = this.#getCLIRetries()\n const cliTimeout = this.#getCLITimeout()\n const cliReporters = this.#getCLIReporters()\n const cliForceExit = this.#getCLIForceExit()\n\n debug('filters applied using CLI flags %O', cliFilters)\n\n const baseConfig: NormalizedBaseConfig = {\n cwd: this.#config.cwd ?? process.cwd(),\n exclude: this.#config.exclude || ['node_modules/**', '.git/**', 'coverage/**'],\n filters: Object.assign({}, this.#config.filters ?? {}, cliFilters),\n importer: this.#config.importer ?? DEFAULTS.importer,\n refiner: this.#config.refiner ?? new Refiner(),\n retries: cliRetries ?? this.#config.retries ?? DEFAULTS.retries,\n timeout: cliTimeout ?? this.#config.timeout ?? DEFAULTS.timeout,\n plugins: this.#config.plugins ?? DEFAULTS.plugins,\n forceExit: cliForceExit ?? this.#config.forceExit ?? DEFAULTS.forceExit,\n reporters: this.#config.reporters\n ? {\n activated: this.#config.reporters.activated,\n list: this.#config.reporters.list || DEFAULTS.reporters.list,\n }\n : DEFAULTS.reporters,\n configureSuite: this.#config.configureSuite ?? DEFAULTS.configureSuite,\n setup: this.#config.setup || [],\n teardown: this.#config.teardown || [],\n }\n\n /**\n * Overwrite activated reporters when defined using CLI\n * flag\n */\n if (cliReporters) {\n baseConfig.reporters.activated = cliReporters\n }\n\n if ('files' in this.#config) {\n return {\n files: this.#config.files,\n ...baseConfig,\n }\n }\n\n return {\n suites: this.#config.suites.map((suite) => {\n return {\n name: suite.name,\n files: suite.files,\n timeout: cliTimeout ?? suite.timeout ?? baseConfig.timeout,\n retries: cliRetries ?? suite.retries ?? baseConfig.retries,\n configure: suite.configure || NOOP,\n }\n }),\n ...baseConfig,\n }\n }\n}\n","/*\n * @japa/runner\n *\n * (c) Japa\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport { Emitter, Group, Refiner, Suite, Test, TestContext } from '../modules/core/main.js'\n\n/**\n * Function to create the test context for the test\n */\nconst contextBuilder = (testInstance: Test<any>) => new TestContext(testInstance)\n\n/**\n * Create a new instance of the Test\n */\nexport function createTest(\n title: string,\n emitter: Emitter,\n refiner: Refiner,\n options: {\n group?: Group\n suite?: Suite\n file?: string\n timeout?: number\n retries?: number\n }\n) {\n const testInstance = new Test<undefined>(title, contextBuilder, emitter, refiner, options.group)\n testInstance.options.meta.suite = options.suite\n testInstance.options.meta.group = options.group\n testInstance.options.meta.fileName = options.file\n\n if (options.timeout !== undefined) {\n testInstance.timeout(options.timeout)\n }\n if (options.retries !== undefined) {\n testInstance.retry(options.retries)\n }\n\n /**\n * Register test as a child either with the group or the suite\n */\n if (options.group) {\n options.group.add(testInstance)\n } else if (options.suite) {\n options.suite.add(testInstance)\n }\n\n return testInstance\n}\n\n/**\n * Create a new instance of the Group\n */\nexport function createTestGroup(\n title: string,\n emitter: Emitter,\n refiner: Refiner,\n options: {\n group?: Group\n suite?: Suite\n file?: string\n timeout?: number\n retries?: number\n }\n) {\n if (options.group) {\n throw new Error('Nested groups are not supported by Japa')\n }\n\n const group = new Group(title, emitter, refiner)\n group.options.meta.suite = options.suite\n group.options.meta.fileName = options.file\n\n if (options.suite) {\n options.suite.add(group)\n }\n\n return group\n}\n"],"mappings":";;;;;;;;;;;;;AAS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AO;AACxB,YAAQ,MAAM,IAAI,YAAY;AAAA,EAChC;AAEA,SAAO;AACT;AAKO,SAAS,gBACd,OACA,SACA,SACA,SAOA;AACA,MAAI,QAAQ,OAAO;AACjB,UAAM,IAAI,MAAM,yCAAyC;AAAA,EAC3D;AAEA,QAAM,QAAQ,IAAI,MAAM,OAAO,SAAS,OAAO;AAC/C,QAAM,QAAQ,KAAK,QAAQ,QAAQ;AACnC,QAAM,QAAQ,KAAK,WAAW,QAAQ;AAEtC,MAAI,QAAQ,OAAO;AACjB,YAAQ,MAAM,IAAI,KAAK;AAAA,EACzB;AAEA,SAAO;AACT;","names":[]}
@@ -5,14 +5,14 @@ import {
5
5
  Planner,
6
6
  createTest,
7
7
  createTestGroup
8
- } from "../chunk-CXTCA2MO.js";
9
- import "../chunk-52OY4QRJ.js";
8
+ } from "../chunk-PSL75GNC.js";
9
+ import "../chunk-6IZE72CL.js";
10
10
  import {
11
11
  Emitter,
12
12
  Runner,
13
13
  Suite
14
14
  } from "../chunk-PKOB3ULJ.js";
15
- import "../chunk-MWYEWO7K.js";
15
+ import "../chunk-OBDV3O36.js";
16
16
 
17
17
  // factories/runner.ts
18
18
  import { fileURLToPath } from "node:url";
package/build/index.js CHANGED
@@ -7,16 +7,16 @@ import {
7
7
  createTestGroup,
8
8
  debug_default,
9
9
  validator_default
10
- } from "./chunk-CXTCA2MO.js";
10
+ } from "./chunk-PSL75GNC.js";
11
11
  import {
12
12
  colors
13
- } from "./chunk-52OY4QRJ.js";
13
+ } from "./chunk-6IZE72CL.js";
14
14
  import {
15
15
  Emitter,
16
16
  Runner,
17
17
  Suite
18
18
  } from "./chunk-PKOB3ULJ.js";
19
- import "./chunk-MWYEWO7K.js";
19
+ import "./chunk-OBDV3O36.js";
20
20
 
21
21
  // index.ts
22
22
  import { fileURLToPath } from "node:url";
@@ -8,7 +8,7 @@ import {
8
8
  Test,
9
9
  TestContext
10
10
  } from "../../chunk-PKOB3ULJ.js";
11
- import "../../chunk-MWYEWO7K.js";
11
+ import "../../chunk-OBDV3O36.js";
12
12
  export {
13
13
  BaseReporter,
14
14
  Emitter,
@@ -9,7 +9,7 @@ export declare class FilesManager {
9
9
  * Returns a collection of files from the user defined
10
10
  * glob or the implementation function
11
11
  */
12
- getFiles(cwd: string, files: TestFiles): Promise<URL[]>;
12
+ getFiles(cwd: string, files: TestFiles, excludes: string[]): Promise<URL[]>;
13
13
  /**
14
14
  * Applies file name filter on a collection of file
15
15
  * URLs
@@ -2,9 +2,9 @@ import {
2
2
  dot,
3
3
  ndjson,
4
4
  spec
5
- } from "../../chunk-52OY4QRJ.js";
5
+ } from "../../chunk-6IZE72CL.js";
6
6
  import "../../chunk-PKOB3ULJ.js";
7
- import "../../chunk-MWYEWO7K.js";
7
+ import "../../chunk-OBDV3O36.js";
8
8
  export {
9
9
  dot,
10
10
  ndjson,
@@ -115,6 +115,14 @@ export type BaseConfig = {
115
115
  * Global hooks to execute on teardown
116
116
  */
117
117
  teardown?: TeardownHookHandler[];
118
+ /**
119
+ * An array of directories to exclude when searching
120
+ * for test files.
121
+ *
122
+ * For example, if you search for test files inside the entire
123
+ * project, you might want to exclude "node_modules"
124
+ */
125
+ exclude?: string[];
118
126
  };
119
127
  /**
120
128
  * A collection of test files defined as a glob or a callback
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __reExport
3
- } from "../chunk-MWYEWO7K.js";
3
+ } from "../chunk-OBDV3O36.js";
4
4
 
5
5
  // src/types.ts
6
6
  var types_exports2 = {};
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/types.ts","../../modules/core/types.ts"],"sourcesContent":["/*\n * @japa/runner\n *\n * (c) Japa\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport type { HookHandler } from '@poppinss/hooks/types'\n\nimport type { Emitter, Refiner, Runner, Suite } from '../modules/core/main.js'\nimport type { FilteringOptions, NamedReporterContract } from '../modules/core/types.js'\n\nexport * from '../modules/core/types.js'\n\n/**\n * Global setup hook\n */\nexport type SetupHookState = [[runner: Runner], [error: Error | null, runner: Runner]]\nexport type SetupHookHandler = HookHandler<SetupHookState[0], SetupHookState[1]>\n\n/**\n * Global teardown hook\n */\nexport type TeardownHookState = [[runner: Runner], [error: Error | null, runner: Runner]]\nexport type TeardownHookHandler = HookHandler<TeardownHookState[0], TeardownHookState[1]>\n\n/**\n * Global set of available hooks\n */\nexport type HooksEvents = {\n setup: SetupHookState\n teardown: TeardownHookState\n}\n\n/**\n * Parsed command-line arguments\n */\nexport type CLIArgs = {\n _?: string[]\n tags?: string | string[]\n files?: string | string[]\n tests?: string | string[]\n groups?: string | string[]\n timeout?: string\n retries?: string\n reporters?: string | string[]\n forceExit?: boolean\n failed?: boolean\n help?: boolean\n matchAll?: boolean\n} & Record<string, string | string[] | boolean>\n\n/**\n * Set of filters you can apply to run only specific tests\n */\nexport type Filters = FilteringOptions & {\n files?: string[]\n suites?: string[]\n}\n\n/**\n * Plugin function receives an instance of the runner,\n * emitter, config and the hooks\n */\nexport type PluginFn = (japa: {\n config: NormalizedConfig\n cliArgs: CLIArgs\n runner: Runner\n emitter: Emitter\n}) => void | Promise<void>\n\n/**\n * Base configuration options\n */\nexport type BaseConfig = {\n /**\n * Current working directory. It is required to search for\n * the test files\n */\n cwd?: string\n\n /**\n * The timeout to apply on all the tests, unless overwritten explicitly\n */\n timeout?: number\n\n /**\n * The retries to apply on all the tests, unless overwritten explicitly\n */\n retries?: number\n\n /**\n * Test filters to apply\n */\n filters?: Filters\n\n /**\n * A hook to configure suites. The callback will be called for each\n * suite before it gets executed.\n */\n configureSuite?: (suite: Suite) => void\n\n /**\n * A collection of registered reporters. Reporters are not activated by\n * default. Either you have to activate them using the commandline,\n * or using the `activated` property.\n */\n reporters?: {\n activated: string[]\n list?: NamedReporterContract[]\n }\n\n /**\n * A collection of registered plugins\n */\n plugins?: PluginFn[]\n\n /**\n * A custom implementation to import test files.\n */\n importer?: (filePath: URL) => void | Promise<void>\n\n /**\n * Overwrite tests refiner. Check documentation for refiner\n * usage\n */\n refiner?: Refiner\n\n /**\n * Enable/disable force exiting.\n */\n forceExit?: boolean\n\n /**\n * Global hooks to execute before importing\n * the test files\n */\n setup?: SetupHookHandler[]\n\n /**\n * Global hooks to execute on teardown\n */\n teardown?: TeardownHookHandler[]\n}\n\n/**\n * A collection of test files defined as a glob or a callback\n * function that returns an array of URLs\n */\nexport type TestFiles = string | string[] | (() => URL[] | Promise<URL[]>)\n\n/**\n * A test suite to register tests under a named suite\n */\nexport type TestSuite = {\n /**\n * A unique name for the suite\n */\n name: string\n\n /**\n * Collection of files associated with the suite. Files should be\n * defined as a glob or a callback function that returns an array of URLs\n */\n files: TestFiles\n\n /**\n * A callback functon to configure the suite. The callback is invoked only\n * when the runner is going to run the tests for the given suite.\n */\n configure?: (suite: Suite) => void\n\n /**\n * The timeout to apply on all the tests in this suite, unless overwritten explicitly\n */\n timeout?: number\n\n /**\n * The retries to apply on all the tests in this suite, unless overwritten explicitly\n */\n retries?: number\n}\n\n/**\n * BaseConfig after normalized by the config manager\n */\nexport type NormalizedBaseConfig = Required<Omit<BaseConfig, 'reporters'>> & {\n reporters: {\n activated: string[]\n list: NamedReporterContract[]\n }\n}\n\n/**\n * Configuration options\n */\nexport type Config = BaseConfig &\n (\n | {\n files: TestFiles\n }\n | {\n suites: TestSuite[]\n }\n )\n\n/**\n * Config after normalized by the config manager\n */\nexport type NormalizedConfig = NormalizedBaseConfig &\n (\n | {\n files: TestFiles\n }\n | {\n suites: Required<TestSuite>[]\n }\n )\n","/*\n * @japa/runner\n *\n * (c) Japa\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nexport * from '@japa/core/types'\n\nexport type BaseReporterOptions = {\n stackLinesCount?: number\n framesMaxLimit?: number\n}\n"],"mappings":";;;;;AAAA,IAAAA,iBAAA;;;ACAA;AASA;AAAA,4BAAc;;;ADKd,WAAAC,gBAAc;","names":["types_exports","types_exports"]}
1
+ {"version":3,"sources":["../../src/types.ts","../../modules/core/types.ts"],"sourcesContent":["/*\n * @japa/runner\n *\n * (c) Japa\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport type { HookHandler } from '@poppinss/hooks/types'\n\nimport type { Emitter, Refiner, Runner, Suite } from '../modules/core/main.js'\nimport type { FilteringOptions, NamedReporterContract } from '../modules/core/types.js'\n\nexport * from '../modules/core/types.js'\n\n/**\n * Global setup hook\n */\nexport type SetupHookState = [[runner: Runner], [error: Error | null, runner: Runner]]\nexport type SetupHookHandler = HookHandler<SetupHookState[0], SetupHookState[1]>\n\n/**\n * Global teardown hook\n */\nexport type TeardownHookState = [[runner: Runner], [error: Error | null, runner: Runner]]\nexport type TeardownHookHandler = HookHandler<TeardownHookState[0], TeardownHookState[1]>\n\n/**\n * Global set of available hooks\n */\nexport type HooksEvents = {\n setup: SetupHookState\n teardown: TeardownHookState\n}\n\n/**\n * Parsed command-line arguments\n */\nexport type CLIArgs = {\n _?: string[]\n tags?: string | string[]\n files?: string | string[]\n tests?: string | string[]\n groups?: string | string[]\n timeout?: string\n retries?: string\n reporters?: string | string[]\n forceExit?: boolean\n failed?: boolean\n help?: boolean\n matchAll?: boolean\n} & Record<string, string | string[] | boolean>\n\n/**\n * Set of filters you can apply to run only specific tests\n */\nexport type Filters = FilteringOptions & {\n files?: string[]\n suites?: string[]\n}\n\n/**\n * Plugin function receives an instance of the runner,\n * emitter, config and the hooks\n */\nexport type PluginFn = (japa: {\n config: NormalizedConfig\n cliArgs: CLIArgs\n runner: Runner\n emitter: Emitter\n}) => void | Promise<void>\n\n/**\n * Base configuration options\n */\nexport type BaseConfig = {\n /**\n * Current working directory. It is required to search for\n * the test files\n */\n cwd?: string\n\n /**\n * The timeout to apply on all the tests, unless overwritten explicitly\n */\n timeout?: number\n\n /**\n * The retries to apply on all the tests, unless overwritten explicitly\n */\n retries?: number\n\n /**\n * Test filters to apply\n */\n filters?: Filters\n\n /**\n * A hook to configure suites. The callback will be called for each\n * suite before it gets executed.\n */\n configureSuite?: (suite: Suite) => void\n\n /**\n * A collection of registered reporters. Reporters are not activated by\n * default. Either you have to activate them using the commandline,\n * or using the `activated` property.\n */\n reporters?: {\n activated: string[]\n list?: NamedReporterContract[]\n }\n\n /**\n * A collection of registered plugins\n */\n plugins?: PluginFn[]\n\n /**\n * A custom implementation to import test files.\n */\n importer?: (filePath: URL) => void | Promise<void>\n\n /**\n * Overwrite tests refiner. Check documentation for refiner\n * usage\n */\n refiner?: Refiner\n\n /**\n * Enable/disable force exiting.\n */\n forceExit?: boolean\n\n /**\n * Global hooks to execute before importing\n * the test files\n */\n setup?: SetupHookHandler[]\n\n /**\n * Global hooks to execute on teardown\n */\n teardown?: TeardownHookHandler[]\n\n /**\n * An array of directories to exclude when searching\n * for test files.\n *\n * For example, if you search for test files inside the entire\n * project, you might want to exclude \"node_modules\"\n */\n exclude?: string[]\n}\n\n/**\n * A collection of test files defined as a glob or a callback\n * function that returns an array of URLs\n */\nexport type TestFiles = string | string[] | (() => URL[] | Promise<URL[]>)\n\n/**\n * A test suite to register tests under a named suite\n */\nexport type TestSuite = {\n /**\n * A unique name for the suite\n */\n name: string\n\n /**\n * Collection of files associated with the suite. Files should be\n * defined as a glob or a callback function that returns an array of URLs\n */\n files: TestFiles\n\n /**\n * A callback functon to configure the suite. The callback is invoked only\n * when the runner is going to run the tests for the given suite.\n */\n configure?: (suite: Suite) => void\n\n /**\n * The timeout to apply on all the tests in this suite, unless overwritten explicitly\n */\n timeout?: number\n\n /**\n * The retries to apply on all the tests in this suite, unless overwritten explicitly\n */\n retries?: number\n}\n\n/**\n * BaseConfig after normalized by the config manager\n */\nexport type NormalizedBaseConfig = Required<Omit<BaseConfig, 'reporters'>> & {\n reporters: {\n activated: string[]\n list: NamedReporterContract[]\n }\n}\n\n/**\n * Configuration options\n */\nexport type Config = BaseConfig &\n (\n | {\n files: TestFiles\n }\n | {\n suites: TestSuite[]\n }\n )\n\n/**\n * Config after normalized by the config manager\n */\nexport type NormalizedConfig = NormalizedBaseConfig &\n (\n | {\n files: TestFiles\n }\n | {\n suites: Required<TestSuite>[]\n }\n )\n","/*\n * @japa/runner\n *\n * (c) Japa\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nexport * from '@japa/core/types'\n\nexport type BaseReporterOptions = {\n stackLinesCount?: number\n framesMaxLimit?: number\n}\n"],"mappings":";;;;;AAAA,IAAAA,iBAAA;;;ACAA;AASA;AAAA,4BAAc;;;ADKd,WAAAC,gBAAc;","names":["types_exports","types_exports"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@japa/runner",
3
3
  "description": "Runner for Japa testing framework",
4
- "version": "3.0.5",
4
+ "version": "3.1.1",
5
5
  "engines": {
6
6
  "node": ">=18.16.0"
7
7
  },
@@ -37,42 +37,42 @@
37
37
  "sync-labels": "github-label-sync --labels .github/labels.json japa/runner"
38
38
  },
39
39
  "devDependencies": {
40
- "@adonisjs/eslint-config": "^1.1.8",
41
- "@adonisjs/prettier-config": "^1.1.8",
42
- "@adonisjs/tsconfig": "^1.1.8",
43
- "@commitlint/cli": "^18.2.0",
44
- "@commitlint/config-conventional": "^18.1.0",
45
- "@swc/core": "^1.3.96",
46
- "@types/chai": "^4.3.9",
47
- "@types/chai-subset": "^1.3.4",
40
+ "@adonisjs/eslint-config": "^1.2.0",
41
+ "@adonisjs/prettier-config": "^1.2.0",
42
+ "@adonisjs/tsconfig": "^1.2.0",
43
+ "@commitlint/cli": "^18.4.3",
44
+ "@commitlint/config-conventional": "^18.4.3",
45
+ "@swc/core": "^1.3.100",
46
+ "@types/chai": "^4.3.11",
47
+ "@types/chai-subset": "^1.3.5",
48
48
  "@types/find-cache-dir": "^5.0.0",
49
- "@types/ms": "^0.7.33",
50
- "@types/node": "^20.8.10",
49
+ "@types/ms": "^0.7.34",
50
+ "@types/node": "^20.10.4",
51
51
  "c8": "^8.0.1",
52
52
  "chai": "^4.3.10",
53
53
  "chai-subset": "^1.6.0",
54
54
  "cross-env": "^7.0.3",
55
55
  "del-cli": "^5.1.0",
56
- "eslint": "^8.53.0",
56
+ "eslint": "^8.56.0",
57
57
  "github-label-sync": "^2.3.1",
58
58
  "glob": "^10.3.10",
59
59
  "husky": "^8.0.3",
60
- "np": "^8.0.4",
61
- "prettier": "^3.0.3",
62
- "ts-node": "^10.9.1",
63
- "tsup": "^7.2.0",
64
- "typescript": "^5.2.2"
60
+ "np": "^9.2.0",
61
+ "prettier": "^3.1.1",
62
+ "ts-node": "^10.9.2",
63
+ "tsup": "^8.0.1",
64
+ "typescript": "^5.3.3"
65
65
  },
66
66
  "dependencies": {
67
- "@japa/core": "^8.1.1",
68
- "@japa/errors-printer": "^3.0.1",
69
- "@poppinss/colors": "^4.1.1",
70
- "@poppinss/hooks": "^7.2.1",
71
- "fast-glob": "^3.3.1",
67
+ "@japa/core": "^9.0.0",
68
+ "@japa/errors-printer": "^3.0.2",
69
+ "@poppinss/colors": "^4.1.2",
70
+ "@poppinss/hooks": "^7.2.2",
71
+ "fast-glob": "^3.3.2",
72
72
  "find-cache-dir": "^5.0.0",
73
73
  "getopts": "^2.3.0",
74
74
  "ms": "^2.1.3",
75
- "serialize-error": "^11.0.0",
75
+ "serialize-error": "^11.0.3",
76
76
  "slash": "^5.1.0"
77
77
  },
78
78
  "author": "virk,japa",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/helpers.ts","../src/reporters/dot.ts","../src/reporters/spec.ts","../src/reporters/ndjson.ts","../src/reporters/main.ts"],"sourcesContent":["/*\n * @japa/runner\n *\n * (c) Japa\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport useColors from '@poppinss/colors'\nimport { Colors } from '@poppinss/colors/types'\n\nexport const colors: Colors = useColors.ansi()\n\n/**\n * A collection of platform specific icons\n */\nexport const icons =\n process.platform === 'win32' && !process.env.WT_SESSION\n ? {\n tick: '√',\n cross: '×',\n bullet: '*',\n nodejs: '♦',\n pointer: '>',\n info: 'i',\n warning: '‼',\n squareSmallFilled: '[█]',\n }\n : {\n tick: '✔',\n cross: '✖',\n bullet: '●',\n nodejs: '⬢',\n pointer: '❯',\n info: 'ℹ',\n warning: '⚠',\n squareSmallFilled: '◼',\n }\n","/*\n * @japa/runner\n *\n * (c) Japa\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport { colors, icons } from '../helpers.js'\nimport type { TestEndNode } from '../../modules/core/types.js'\nimport { BaseReporter } from '../../modules/core/reporters/base.js'\n\n/**\n * Minimal reporter that prints each test as an icon.\n */\nexport class DotReporter extends BaseReporter {\n /**\n * When a test ended\n */\n protected onTestEnd(payload: TestEndNode) {\n let output = ''\n if (payload.isTodo) {\n output = colors.cyan(icons.info)\n } else if (payload.hasError || payload.isFailing) {\n output = payload.hasError ? colors.magenta(icons.squareSmallFilled) : colors.red(icons.cross)\n } else if (payload.isSkipped) {\n output = colors.yellow(icons.bullet)\n } else {\n output = colors.green(icons.tick)\n }\n\n process.stdout.write(`${output}`)\n }\n\n /**\n * When test runner ended\n */\n protected async end() {\n console.log('')\n await this.printSummary(this.runner!.getSummary())\n }\n}\n","/*\n * @japa/runner\n *\n * (c) Japa\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport ms from 'ms'\nimport { relative } from 'node:path'\n\nimport { colors, icons } from '../helpers.js'\nimport { BaseReporter } from '../../modules/core/main.js'\nimport { GroupStartNode, TestEndNode } from '../../modules/core/types.js'\n\n/**\n * Pretty prints the tests on the console\n */\nexport class SpecReporter extends BaseReporter {\n /**\n * Tracking if the first event we get is for a test without any parent group\n * We need this to decide the display style for tests without groups.\n */\n #isFirstLoneTest = true\n\n /**\n * Returns the icon for the test\n */\n #getTestIcon(payload: TestEndNode) {\n if (payload.isTodo) {\n return colors.cyan(icons.info)\n }\n\n if (payload.isFailing) {\n return payload.hasError ? colors.magenta(icons.squareSmallFilled) : colors.red(icons.cross)\n }\n\n if (payload.hasError) {\n return colors.red(icons.cross)\n }\n\n if (payload.isSkipped) {\n return colors.yellow(icons.bullet)\n }\n\n return colors.green(icons.tick)\n }\n\n /**\n * Returns the test message\n */\n #getTestMessage(payload: TestEndNode) {\n const message = typeof payload.title === 'string' ? payload.title : payload.title.expanded\n\n if (payload.isTodo) {\n return colors.blue(message)\n }\n\n if (payload.isFailing) {\n return payload.hasError ? colors.magenta(message) : colors.red(message)\n }\n\n if (payload.hasError) {\n return colors.red(message)\n }\n\n if (payload.isSkipped) {\n return colors.yellow(message)\n }\n\n return colors.grey(message)\n }\n\n /**\n * Returns the subtext message for the test\n */\n #getSubText(payload: TestEndNode): string | undefined {\n if (payload.isSkipped && payload.skipReason) {\n return colors.yellow(payload.skipReason)\n }\n\n if (!payload.isFailing) {\n return\n }\n\n if (!payload.hasError) {\n return colors.magenta(`Test marked with \".fails()\" must finish with an error`)\n }\n\n if (payload.failReason) {\n return colors.magenta(payload.failReason)\n }\n\n const testErrorMessage = payload.errors.find((error) => error.phase === 'test')\n if (testErrorMessage && testErrorMessage.error) {\n return colors.magenta(testErrorMessage.error.message)\n }\n }\n\n /**\n * Returns the filename relative from the current working dir\n */\n #getRelativeFilename(fileName: string) {\n return relative(process.cwd(), fileName)\n }\n\n /**\n * Prints the test details\n */\n #printTest(payload: TestEndNode) {\n const icon = this.#getTestIcon(payload)\n const message = this.#getTestMessage(payload)\n const prefix = payload.isPinned ? colors.yellow('[PINNED] ') : ''\n const indentation = this.currentFileName || this.currentGroupName ? ' ' : ''\n const duration = colors.dim(`(${ms(Number(payload.duration.toFixed(2)))})`)\n const retries =\n payload.retryAttempt && payload.retryAttempt > 1\n ? colors.dim(`(x${payload.retryAttempt}) `)\n : ''\n\n let subText = this.#getSubText(payload)\n subText = subText ? `\\n${indentation} ${subText}` : ''\n\n console.log(`${indentation}${icon} ${prefix}${retries}${message} ${duration}${subText}`)\n }\n\n /**\n * Prints the group name\n */\n #printGroup(payload: GroupStartNode) {\n const title =\n this.currentSuiteName !== 'default'\n ? `${this.currentSuiteName} / ${payload.title}`\n : payload.title\n\n const suffix = this.currentFileName\n ? colors.dim(` (${this.#getRelativeFilename(this.currentFileName)})`)\n : ''\n\n console.log(`\\n${title}${suffix}`)\n }\n\n protected onTestStart(): void {\n /**\n * Display the filename when\n *\n * - The filename exists\n * - The test is not under a group\n * - Test is first in a sequence\n */\n if (this.currentFileName && this.#isFirstLoneTest) {\n console.log(`\\n${colors.dim(this.#getRelativeFilename(this.currentFileName))}`)\n }\n this.#isFirstLoneTest = false\n }\n\n protected onTestEnd(payload: TestEndNode): void {\n this.#printTest(payload)\n }\n\n protected onGroupStart(payload: GroupStartNode): void {\n /**\n * When a group starts, we mark the upcoming test as NOT a\n * lone test\n */\n this.#isFirstLoneTest = false\n this.#printGroup(payload)\n }\n\n protected onGroupEnd(): void {\n /**\n * When the group ends we assume that the next test can\n * be out of the group, hence a lone test.\n *\n * If this assumption is false, then the `onGroupStart` method\n * will toggle the boolean\n */\n this.#isFirstLoneTest = true\n }\n\n protected async end() {\n const summary = this.runner!.getSummary()\n await this.printSummary(summary)\n }\n}\n","/*\n * @japa/runner\n *\n * (c) Japa\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport { relative } from 'node:path'\nimport { serializeError } from 'serialize-error'\n\nimport { BaseReporter } from '../../modules/core/main.js'\nimport type {\n TestEndNode,\n SuiteEndNode,\n GroupEndNode,\n SuiteStartNode,\n GroupStartNode,\n} from '../../modules/core/types.js'\n\n/**\n * Prints tests progress as JSON. Each event is emitted\n * independently\n */\nexport class NdJSONReporter extends BaseReporter {\n /**\n * Returns the filename relative from the current working dir\n */\n #getRelativeFilename(fileName: string) {\n return relative(process.cwd(), fileName)\n }\n\n /**\n * Serialize errors to JSON\n */\n #serializeErrors(errors: TestEndNode['errors']) {\n return errors.map((error) => ({\n phase: error.phase,\n error: serializeError(error.error),\n }))\n }\n\n protected onTestEnd(payload: TestEndNode): void {\n console.log(\n JSON.stringify({\n event: 'test:end',\n filePath: this.currentFileName,\n relativePath: this.currentFileName\n ? this.#getRelativeFilename(this.currentFileName)\n : undefined,\n title: payload.title,\n duration: payload.duration,\n failReason: payload.failReason,\n isFailing: payload.isFailing,\n skipReason: payload.skipReason,\n isSkipped: payload.isSkipped,\n isTodo: payload.isTodo,\n isPinned: payload.isPinned,\n retryAttempt: payload.retryAttempt,\n retries: payload.retries,\n errors: this.#serializeErrors(payload.errors),\n })\n )\n }\n\n protected onGroupStart(payload: GroupStartNode): void {\n console.log(\n JSON.stringify({\n event: 'group:start',\n title: payload.title,\n })\n )\n }\n\n protected onGroupEnd(payload: GroupEndNode): void {\n JSON.stringify({\n event: 'group:end',\n title: payload.title,\n errors: this.#serializeErrors(payload.errors),\n })\n }\n\n protected onSuiteStart(payload: SuiteStartNode): void {\n console.log(\n JSON.stringify({\n event: 'suite:start',\n ...payload,\n })\n )\n }\n\n protected onSuiteEnd(payload: SuiteEndNode): void {\n console.log(\n JSON.stringify({\n event: 'suite:end',\n ...payload,\n })\n )\n }\n\n protected async end() {\n const summary = this.runner!.getSummary()\n console.log(\n JSON.stringify({\n aggregates: summary.aggregates,\n duration: summary.duration,\n failedTestsTitles: summary.failedTestsTitles,\n hasError: summary.hasError,\n })\n )\n }\n}\n","/*\n * @japa/runner\n *\n * (c) Japa\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport { DotReporter } from './dot.js'\nimport { SpecReporter } from './spec.js'\nimport { NdJSONReporter } from './ndjson.js'\nimport type { BaseReporterOptions, NamedReporterContract } from '../types.js'\n\n/**\n * Create an instance of the spec reporter\n */\nexport const spec: (options?: BaseReporterOptions) => NamedReporterContract = (options) => {\n return {\n name: 'spec',\n handler: (...args) => new SpecReporter(options).boot(...args),\n }\n}\n\n/**\n * Create an instance of the dot reporter\n */\nexport const dot: (options?: BaseReporterOptions) => NamedReporterContract = (options) => {\n return {\n name: 'dot',\n handler: (...args) => new DotReporter(options).boot(...args),\n }\n}\n\n/**\n * Create an instance of the ndjson reporter\n */\nexport const ndjson: (options?: BaseReporterOptions) => NamedReporterContract = (options) => {\n return {\n name: 'ndjson',\n handler: (...args) => new NdJSONReporter(options).boot(...args),\n }\n}\n"],"mappings":";;;;;AASA,OAAO,eAAe;AAGf,IAAM,SAAiB,UAAU,KAAK;AAKtC,IAAM,QACX,QAAQ,aAAa,WAAW,CAAC,QAAQ,IAAI,aACzC;AAAA,EACE,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,MAAM;AAAA,EACN,SAAS;AAAA,EACT,mBAAmB;AACrB,IACA;AAAA,EACE,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,MAAM;AAAA,EACN,SAAS;AAAA,EACT,mBAAmB;AACrB;;;ACtBC,IAAM,cAAN,cAA0B,aAAa;AAAA;AAAA;AAAA;AAAA,EAIlC,UAAU,SAAsB;AACxC,QAAI,SAAS;AACb,QAAI,QAAQ,QAAQ;AAClB,eAAS,OAAO,KAAK,MAAM,IAAI;AAAA,IACjC,WAAW,QAAQ,YAAY,QAAQ,WAAW;AAChD,eAAS,QAAQ,WAAW,OAAO,QAAQ,MAAM,iBAAiB,IAAI,OAAO,IAAI,MAAM,KAAK;AAAA,IAC9F,WAAW,QAAQ,WAAW;AAC5B,eAAS,OAAO,OAAO,MAAM,MAAM;AAAA,IACrC,OAAO;AACL,eAAS,OAAO,MAAM,MAAM,IAAI;AAAA,IAClC;AAEA,YAAQ,OAAO,MAAM,GAAG,MAAM,EAAE;AAAA,EAClC;AAAA;AAAA;AAAA;AAAA,EAKA,MAAgB,MAAM;AACpB,YAAQ,IAAI,EAAE;AACd,UAAM,KAAK,aAAa,KAAK,OAAQ,WAAW,CAAC;AAAA,EACnD;AACF;;;ACjCA,OAAO,QAAQ;AACf,SAAS,gBAAgB;AASlB,IAAM,eAAN,cAA2B,aAAa;AA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AI,SAAS,IAAI,YAAY,OAAO,EAAE,KAAK,GAAG,IAAI;AAAA,EAC7D;AACF;AAKO,IAAM,SAAmE,CAAC,YAAY;AAC3F,SAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS,IAAI,SAAS,IAAI,eAAe,OAAO,EAAE,KAAK,GAAG,IAAI;AAAA,EAChE;AACF;","names":["relative","relative"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/debug.ts","../src/validator.ts","../src/files_manager.ts","../src/planner.ts","../src/hooks.ts","../src/cli_parser.ts","../src/config_manager.ts","../src/create_test.ts"],"sourcesContent":["/*\n * @japa/runner\n *\n * (c) Japa\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport { debuglog } from 'node:util'\nexport default debuglog('japa:runner')\n","/*\n * @japa/runner\n *\n * (c) Japa\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport { NormalizedConfig } from './types.js'\n\n/**\n * Validator encapsulates the validations to perform before running\n * the tests\n */\nclass Validator {\n /**\n * Ensures the japa is configured. Otherwise raises an exception\n */\n ensureIsConfigured(config: NormalizedConfig | undefined) {\n if (!config) {\n throw new Error(\n `Cannot run tests. Make sure to call \"configure\" method before the \"run\" method`\n )\n }\n }\n\n /**\n * Ensures the japa is in planning phase\n */\n ensureIsInPlanningPhase(phase: 'idle' | 'planning' | 'executing') {\n if (phase !== 'planning') {\n throw new Error(\n `Cannot import japa test file directly. It must be imported by calling the \"japa.run\" method`\n )\n }\n }\n\n /**\n * Ensures the suites filter uses a subset of the user configured suites.\n */\n validateSuitesFilter(config: NormalizedConfig) {\n /**\n * Do not perform any validation if no filters are applied\n * in the first place\n */\n if (!config.filters.suites || !config.filters.suites.length) {\n return\n }\n\n /**\n * Notify user they have applied the suites filter but forgot to define\n * suites\n */\n if (!('suites' in config) || !config.suites.length) {\n throw new Error(`Cannot apply suites filter. You have not configured any test suites`)\n }\n\n const suites = config.suites.map(({ name }) => name)\n\n /**\n * Find unknown suites and report the error\n */\n const unknownSuites = config.filters.suites.filter((suite) => !suites.includes(suite))\n if (unknownSuites.length) {\n throw new Error(`Cannot apply suites filter. \"${unknownSuites[0]}\" suite is not configured`)\n }\n }\n\n /**\n * Ensure there are unique suites\n */\n validateSuitesForUniqueness(config: NormalizedConfig) {\n if (!('suites' in config)) {\n return\n }\n\n const suites: Set<string> = new Set()\n config.suites.forEach(({ name }) => {\n if (suites.has(name)) {\n throw new Error(`Duplicate suite \"${name}\"`)\n }\n suites.add(name)\n })\n\n suites.clear()\n }\n\n /**\n * Ensure the activated reporters are in the list of defined\n * reporters\n */\n validateActivatedReporters(config: NormalizedConfig) {\n const reportersList = config.reporters.list.map(({ name }) => name)\n const unknownReporters = config.reporters.activated.filter(\n (name) => !reportersList.includes(name)\n )\n\n if (unknownReporters.length) {\n throw new Error(\n `Invalid reporter \"${unknownReporters[0]}\". Make sure to register it first inside the \"reporters.list\" array`\n )\n }\n }\n}\n\nexport default new Validator()\n","/*\n * @japa/runner\n *\n * (c) Japa\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport slash from 'slash'\nimport fastGlob from 'fast-glob'\nimport { pathToFileURL } from 'node:url'\nimport type { TestFiles } from './types.js'\n\n/**\n * The expression to remove file extension and optionally\n * .spec|.test from the test file name\n */\nconst FILE_SUFFIX_EXPRESSION = /(\\.spec|\\.test)?\\.[js|ts|jsx|tsx|mjs|mts|cjs|cts]+$/\n\n/**\n * Files manager exposes the API to collect, filter and import test\n * files based upon the config\n */\nexport class FilesManager {\n /**\n * Returns a collection of files from the user defined\n * glob or the implementation function\n */\n async getFiles(cwd: string, files: TestFiles): Promise<URL[]> {\n if (Array.isArray(files) || typeof files === 'string') {\n const testFiles = await fastGlob(files, {\n absolute: true,\n onlyFiles: true,\n cwd: cwd,\n })\n return testFiles.map((file) => pathToFileURL(file))\n }\n\n return await files()\n }\n\n /**\n * Applies file name filter on a collection of file\n * URLs\n */\n grep(files: URL[], filters: string[]): URL[] {\n return files.filter((file) => {\n const filename = slash(file.pathname)\n const filenameWithoutTestSuffix = filename.replace(FILE_SUFFIX_EXPRESSION, '')\n\n return !!filters.find((filter) => {\n if (filename.endsWith(filter)) {\n return true\n }\n\n const filterSegments = filter.split('/').reverse()\n const fileSegments = filenameWithoutTestSuffix.split('/').reverse()\n\n return filterSegments.every((segment, index) => {\n return fileSegments[index] && (segment === '*' || fileSegments[index].endsWith(segment))\n })\n })\n })\n }\n}\n","/*\n * @japa/runner\n *\n * (c) Japa\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport validator from './validator.js'\nimport { FilesManager } from './files_manager.js'\nimport type { NamedReporterContract, NormalizedConfig, TestFiles, TestSuite } from './types.js'\n\n/**\n * The tests planner is used to plan the tests by doing all\n * the heavy lifting of executing plugins, registering\n * reporters, filtering tests and so on.\n */\nexport class Planner {\n #config: NormalizedConfig\n #fileManager = new FilesManager()\n\n constructor(config: NormalizedConfig) {\n validator.validateActivatedReporters(config!)\n validator.validateSuitesFilter(config!)\n validator.validateSuitesForUniqueness(config!)\n this.#config = config\n }\n\n /**\n * Returns a list of reporters based upon the activated\n * reporters list.\n */\n #getActivatedReporters(): NamedReporterContract[] {\n return this.#config.reporters.activated.map((activated) => {\n return this.#config.reporters.list.find(({ name }) => activated === name)!\n })\n }\n\n /**\n * A generic method to collect files from the user defined\n * files glob and apply the files filter\n */\n async #collectFiles(files: TestFiles) {\n let filesURLs = await this.#fileManager.getFiles(this.#config.cwd, files)\n if (this.#config.filters.files && this.#config.filters.files.length) {\n filesURLs = this.#fileManager.grep(filesURLs, this.#config.filters.files)\n }\n\n return filesURLs\n }\n\n /**\n * Returns a collection of suites and their associated\n * test files by applying all the filters\n */\n async #getSuites(): Promise<(TestSuite & { filesURLs: URL[] })[]> {\n let suites: (TestSuite & { filesURLs: URL[] })[] = []\n let suitesFilters = this.#config.filters.suites || []\n\n if ('files' in this.#config) {\n suites.push({\n name: 'default',\n files: this.#config.files,\n timeout: this.#config.timeout,\n retries: this.#config.retries,\n filesURLs: await this.#collectFiles(this.#config.files),\n })\n }\n\n if ('suites' in this.#config) {\n for (let suite of this.#config.suites) {\n if (!suitesFilters.length || suitesFilters.includes(suite.name)) {\n suites.push({\n ...suite,\n filesURLs: await this.#collectFiles(suite.files),\n })\n }\n }\n }\n\n return suites\n }\n\n /**\n * Returns a list of filters to the passed to the refiner\n */\n #getRefinerFilters() {\n return Object.keys(this.#config.filters).reduce(\n (result, layer) => {\n if (layer === 'tests' || layer === 'tags' || layer === 'groups') {\n result.push({ layer, filters: this.#config.filters[layer]! })\n }\n return result\n },\n [] as { layer: 'tags' | 'tests' | 'groups'; filters: string[] }[]\n )\n }\n\n /**\n * Creates a plan for running the tests\n */\n async plan() {\n const suites = await this.#getSuites()\n const reporters = this.#getActivatedReporters()\n const refinerFilters = this.#getRefinerFilters()\n return {\n reporters,\n suites,\n refinerFilters,\n config: this.#config,\n }\n }\n}\n","/*\n * @japa/runner\n *\n * (c) Japa\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport Hooks from '@poppinss/hooks'\nimport type { Runner as HooksRunner } from '@poppinss/hooks/types'\n\nimport { Runner } from '../modules/core/main.js'\nimport type { HooksEvents, SetupHookState, NormalizedConfig, TeardownHookState } from './types.js'\n\n/**\n * Exposes API for working with global hooks\n */\nexport class GlobalHooks {\n #hooks = new Hooks<HooksEvents>()\n #setupRunner: HooksRunner<SetupHookState[0], SetupHookState[1]> | undefined\n #teardownRunner: HooksRunner<TeardownHookState[0], TeardownHookState[1]> | undefined\n\n /**\n * Apply hooks from the config\n */\n apply(config: NormalizedConfig) {\n config.setup.forEach((hook) => this.#hooks.add('setup', hook))\n config.teardown.forEach((hook) => this.#hooks.add('teardown', hook))\n }\n\n /**\n * Perform setup\n */\n async setup(runner: Runner) {\n this.#setupRunner = this.#hooks.runner('setup')\n this.#teardownRunner = this.#hooks.runner('teardown')\n await this.#setupRunner.run(runner)\n }\n\n /**\n * Perform cleanup\n */\n async teardown(error: Error | null, runner: Runner) {\n if (this.#setupRunner) {\n await this.#setupRunner.cleanup(error, runner)\n }\n if (this.#teardownRunner) {\n if (!error) {\n await this.#teardownRunner.run(runner)\n }\n await this.#teardownRunner.cleanup(error, runner)\n }\n }\n}\n","/*\n * @japa/runner\n *\n * (c) Japa\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\n// @ts-ignore-error\nimport getopts from 'getopts'\nimport colors from '@poppinss/colors'\nimport type { CLIArgs } from './types.js'\n\nconst ansi = colors.ansi()\n\n/**\n * Known commandline options. The user can still define additional flags and they\n * will be parsed aswell, but without any normalization\n */\nconst OPTIONS = {\n string: ['tests', 'groups', 'tags', 'files', 'timeout', 'retries', 'reporters', 'failed'],\n boolean: ['help', 'matchAll', 'failed'],\n alias: {\n forceExit: 'force-exit',\n matchAll: 'match-all',\n help: 'h',\n },\n}\n\n/**\n * Help string to display when the `--help flag is used`\n */\nconst GET_HELP = () => `\n${ansi.yellow('@japa/runner v2.3.0')}\n\n${ansi.green('--tests')} ${ansi.dim('Filter tests by the test title')}\n${ansi.green('--groups')} ${ansi.dim('Filter tests by the group title')}\n${ansi.green('--tags')} ${ansi.dim('Filter tests by tags')}\n${ansi.green('--files')} ${ansi.dim('Filter tests by the file name')}\n${ansi.green('--force-exit')} ${ansi.dim('Forcefully exit the process')}\n${ansi.green('--timeout')} ${ansi.dim('Define default timeout for all tests')}\n${ansi.green('--retries')} ${ansi.dim('Define default retries for all tests')}\n${ansi.green('--reporters')} ${ansi.dim('Activate one or more test reporters')}\n${ansi.green('--failed')} ${ansi.dim('Run tests failed during the last run')}\n${ansi.green('-h, --help')} ${ansi.dim('View help')}\n\n${ansi.yellow('Examples:')}\n${ansi.dim('node bin/test.js --tags=\"@github\"')}\n${ansi.dim('node bin/test.js --tags=\"~@github\"')}\n${ansi.dim('node bin/test.js --tags=\"@github,@slow,@integration\" --match-all')}\n${ansi.dim('node bin/test.js --force-exit')}\n${ansi.dim('node bin/test.js --files=\"user\"')}\n${ansi.dim('node bin/test.js --files=\"functional/user\"')}\n${ansi.dim('node bin/test.js --files=\"unit/user\"')}\n\n${ansi.yellow('Notes:')}\n- When groups and tests filters are applied together. We will first filter the\n tests by group title and then apply the tests title filter.\n- The timeout defined on test object takes precedence over the ${ansi.green('--timeout')} flag.\n- The retries defined on test object takes precedence over the ${ansi.green('--retries')} flag.\n- The ${ansi.green('--files')} flag checks for the file names ending with the filter substring.\n`\n\n/**\n * CLI Parser is used to parse the commandline argument\n */\nexport class CliParser {\n /**\n * Parses command-line arguments\n */\n parse(argv: string[]): CLIArgs {\n return getopts(argv, OPTIONS)\n }\n\n /**\n * Returns the help string\n */\n getHelp() {\n return GET_HELP()\n }\n}\n","/*\n * @japa/runner\n *\n * (c) Japa\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport debug from './debug.js'\nimport { Refiner } from '../modules/core/main.js'\nimport { dot, ndjson, spec } from './reporters/main.js'\nimport type { CLIArgs, Config, Filters, NormalizedBaseConfig, NormalizedConfig } from './types.js'\n\nexport const NOOP = () => {}\n\n/**\n * Defaults to use for configuration\n */\nconst DEFAULTS = {\n files: [],\n timeout: 2000,\n retries: 0,\n forceExit: false,\n plugins: [],\n reporters: {\n activated: ['spec'],\n list: [spec(), ndjson(), dot()],\n },\n importer: (filePath) => import(filePath.href),\n configureSuite: () => {},\n} satisfies Config\n\n/**\n * Config manager is used to hydrate the configuration by merging\n * the defaults, user defined config and the command line\n * flags.\n *\n * The command line flags have the upmost priority\n */\nexport class ConfigManager {\n #config: Config\n #cliArgs: CLIArgs\n\n constructor(config: Config, cliArgs: CLIArgs) {\n this.#config = config\n this.#cliArgs = cliArgs\n }\n\n /**\n * Processes a CLI argument and converts it to an\n * array of strings\n */\n #processAsArray(value: string | string[]): string[] {\n return Array.isArray(value) ? value : value.split(',').map((item: string) => item.trim())\n }\n\n /**\n * Returns a copy of filters based upon the CLI\n * arguments.\n */\n #getCLIFilters(): Filters {\n const filters: Filters = {}\n\n if (this.#cliArgs.tags) {\n filters.tags = this.#processAsArray(this.#cliArgs.tags)\n }\n if (this.#cliArgs.tests) {\n filters.tests = this.#processAsArray(this.#cliArgs.tests)\n }\n if (this.#cliArgs.files) {\n filters.files = this.#processAsArray(this.#cliArgs.files)\n }\n if (this.#cliArgs.groups) {\n filters.groups = this.#processAsArray(this.#cliArgs.groups)\n }\n if (this.#cliArgs._ && this.#cliArgs._.length) {\n filters.suites = this.#processAsArray(this.#cliArgs._)\n }\n\n return filters\n }\n\n /**\n * Returns the timeout from the CLI args\n */\n #getCLITimeout(): number | undefined {\n if (this.#cliArgs.timeout) {\n const value = Number(this.#cliArgs.timeout)\n if (!Number.isNaN(value)) {\n return value\n }\n }\n }\n\n /**\n * Returns the retries from the CLI args\n */\n #getCLIRetries(): number | undefined {\n if (this.#cliArgs.retries) {\n const value = Number(this.#cliArgs.retries)\n if (!Number.isNaN(value)) {\n return value\n }\n }\n }\n\n /**\n * Returns the forceExit property from the CLI args\n */\n #getCLIForceExit(): boolean | undefined {\n if (this.#cliArgs.forceExit) {\n return true\n }\n }\n\n /**\n * Returns reporters selected using the commandline\n * --reporter flag\n */\n #getCLIReporters(): string[] | undefined {\n if (this.#cliArgs.reporters) {\n return this.#processAsArray(this.#cliArgs.reporters)\n }\n }\n\n /**\n * Hydrates the config with user defined options and the\n * command-line flags.\n */\n hydrate(): NormalizedConfig {\n const cliFilters = this.#getCLIFilters()\n const cliRetries = this.#getCLIRetries()\n const cliTimeout = this.#getCLITimeout()\n const cliReporters = this.#getCLIReporters()\n const cliForceExit = this.#getCLIForceExit()\n\n debug('filters applied using CLI flags %O', cliFilters)\n\n const baseConfig: NormalizedBaseConfig = {\n cwd: this.#config.cwd ?? process.cwd(),\n filters: Object.assign({}, this.#config.filters ?? {}, cliFilters),\n importer: this.#config.importer ?? DEFAULTS.importer,\n refiner: this.#config.refiner ?? new Refiner(),\n retries: cliRetries ?? this.#config.retries ?? DEFAULTS.retries,\n timeout: cliTimeout ?? this.#config.timeout ?? DEFAULTS.timeout,\n plugins: this.#config.plugins ?? DEFAULTS.plugins,\n forceExit: cliForceExit ?? this.#config.forceExit ?? DEFAULTS.forceExit,\n reporters: this.#config.reporters\n ? {\n activated: this.#config.reporters.activated,\n list: this.#config.reporters.list || DEFAULTS.reporters.list,\n }\n : DEFAULTS.reporters,\n configureSuite: this.#config.configureSuite ?? DEFAULTS.configureSuite,\n setup: this.#config.setup || [],\n teardown: this.#config.teardown || [],\n }\n\n /**\n * Overwrite activated reporters when defined using CLI\n * flag\n */\n if (cliReporters) {\n baseConfig.reporters.activated = cliReporters\n }\n\n if ('files' in this.#config) {\n return {\n files: this.#config.files,\n ...baseConfig,\n }\n }\n\n return {\n suites: this.#config.suites.map((suite) => {\n return {\n name: suite.name,\n files: suite.files,\n timeout: cliTimeout ?? suite.timeout ?? baseConfig.timeout,\n retries: cliRetries ?? suite.retries ?? baseConfig.retries,\n configure: suite.configure || NOOP,\n }\n }),\n ...baseConfig,\n }\n }\n}\n","/*\n * @japa/runner\n *\n * (c) Japa\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport { Emitter, Group, Refiner, Suite, Test, TestContext } from '../modules/core/main.js'\n\n/**\n * Function to create the test context for the test\n */\nconst contextBuilder = (testInstance: Test<any>) => new TestContext(testInstance)\n\n/**\n * Create a new instance of the Test\n */\nexport function createTest(\n title: string,\n emitter: Emitter,\n refiner: Refiner,\n options: {\n group?: Group\n suite?: Suite\n file?: string\n timeout?: number\n retries?: number\n }\n) {\n const testInstance = new Test<undefined>(title, contextBuilder, emitter, refiner, options.group)\n testInstance.options.meta.suite = options.suite\n testInstance.options.meta.group = options.group\n testInstance.options.meta.fileName = options.file\n\n if (options.timeout !== undefined) {\n testInstance.timeout(options.timeout)\n }\n if (options.retries !== undefined) {\n testInstance.retry(options.retries)\n }\n\n /**\n * Register test as a child either with the group or the suite\n */\n if (options.group) {\n options.group.add(testInstance)\n } else if (options.suite) {\n options.suite.add(testInstance)\n }\n\n return testInstance\n}\n\n/**\n * Create a new instance of the Group\n */\nexport function createTestGroup(\n title: string,\n emitter: Emitter,\n refiner: Refiner,\n options: {\n group?: Group\n suite?: Suite\n file?: string\n timeout?: number\n retries?: number\n }\n) {\n if (options.group) {\n throw new Error('Nested groups are not supported by Japa')\n }\n\n const group = new Group(title, emitter, refiner)\n group.options.meta.suite = options.suite\n group.options.meta.fileName = options.file\n\n if (options.suite) {\n options.suite.add(group)\n }\n\n return group\n}\n"],"mappings":";;;;;;;;;;;;;AASA,SAAS,gBAAgB;AACzB,IAAO,gBAAQ,SAAS,aAAa;;;ACKrC,IAAM,YAAN,MAAgB;AAAA;AAAA;AAAA;AAAA,EAId,mBAAmB,QAAsC;AACvD,QAAI,CAAC,QAAQ;AACX,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,wBAAwB,OAA0C;AAChE,QAAI,UAAU,YAAY;AACxB,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,qBAAqB,QAA0B;AAK7C,QAAI,CAAC,OAAO,QAAQ,UAAU,CAAC,OAAO,QAAQ,OAAO,QAAQ;AAC3D;AAAA,IACF;AAMA,QAAI,EAAE,YAAY,WAAW,CAAC,OAAO,OAAO,QAAQ;AAClD,YAAM,IAAI,MAAM,qEAAqE;AAAA,IACvF;AAEA,UAAM,SAAS,OAAO,OAAO,IAAI,CAAC,EAAE,KAAK,MAAM,IAAI;AAKnD,UAAM,gBAAgB,OAAO,QAAQ,OAAO,OAAO,CAAC,UAAU,CAAC,OAAO,SAAS,KAAK,CAAC;AACrF,QAAI,cAAc,QAAQ;AACxB,YAAM,IAAI,MAAM,gCAAgC,cAAc,CAAC,CAAC,2BAA2B;AAAA,IAC7F;AAAA,EACF;AAA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