Replace MOCHA_GREP with TEST_NAME_PATTERN (#34404)

GitOrigin-RevId: b1b2d1be3d0725f930d83ef035836482ffb72dcd
This commit is contained in:
Anna Claire Fields
2026-09-17 11:45:29 +00:00
committed by Copybot
parent daf4a0e412
commit a63fd554c3
37 changed files with 47 additions and 40 deletions
@@ -1,7 +1,7 @@
module.exports = { module.exports = {
reporterEnabled: 'spec, mocha-junit-reporter', reporterEnabled: 'spec, mocha-junit-reporter',
mochaJunitReporterReporterOptions: { mochaJunitReporterReporterOptions: {
mochaFile: `reports/junit-mocha-${process.env.MOCHA_GREP}.xml`, mochaFile: `reports/junit-mocha-${process.env.TEST_NAME_PATTERN}.xml`,
includePending: true, includePending: true,
jenkinsMode: true, jenkinsMode: true,
output: true, output: true,
@@ -1,7 +1,7 @@
module.exports = { module.exports = {
reporterEnabled: 'spec, mocha-junit-reporter', reporterEnabled: 'spec, mocha-junit-reporter',
mochaJunitReporterReporterOptions: { mochaJunitReporterReporterOptions: {
mochaFile: `reports/junit-mocha-${process.env.MOCHA_GREP}.xml`, mochaFile: `reports/junit-mocha-${process.env.TEST_NAME_PATTERN}.xml`,
includePending: true, includePending: true,
jenkinsMode: true, jenkinsMode: true,
output: true, output: true,
+1 -1
View File
@@ -37,7 +37,7 @@
"lint": "eslint --cache --cache-location ../../.cache/eslint/ --ext .cjs,.js,.jsx,.mjs,.ts --max-warnings 0 .", "lint": "eslint --cache --cache-location ../../.cache/eslint/ --ext .cjs,.js,.jsx,.mjs,.ts --max-warnings 0 .",
"lint:fix": "eslint --cache --cache-location ../../.cache/eslint/ --fix --ext .cjs,.js,.jsx,.mjs,.ts .", "lint:fix": "eslint --cache --cache-location ../../.cache/eslint/ --fix --ext .cjs,.js,.jsx,.mjs,.ts .",
"test:unit": "mocha --exit test/**/*.{js,cjs}", "test:unit": "mocha --exit test/**/*.{js,cjs}",
"test:acceptance": "mocha --recursive --exit --grep=${MOCHA_GREP:-} test/acceptance", "test:acceptance": "mocha --recursive --exit --grep=${TEST_NAME_PATTERN:-} test/acceptance",
"test": "yarn run lint && yarn run types:check && yarn run test:unit", "test": "yarn run lint && yarn run types:check && yarn run test:unit",
"test:ci": "yarn run test:unit", "test:ci": "yarn run test:unit",
"types:check": "tsc --noEmit" "types:check": "tsc --noEmit"
@@ -1,7 +1,7 @@
module.exports = { module.exports = {
reporterEnabled: 'spec, mocha-junit-reporter', reporterEnabled: 'spec, mocha-junit-reporter',
mochaJunitReporterReporterOptions: { mochaJunitReporterReporterOptions: {
mochaFile: `reports/junit-mocha-${process.env.MOCHA_GREP}.xml`, mochaFile: `reports/junit-mocha-${process.env.TEST_NAME_PATTERN}.xml`,
includePending: true, includePending: true,
jenkinsMode: true, jenkinsMode: true,
output: true, output: true,
@@ -1,7 +1,7 @@
module.exports = { module.exports = {
reporterEnabled: 'spec, mocha-junit-reporter', reporterEnabled: 'spec, mocha-junit-reporter',
mochaJunitReporterReporterOptions: { mochaJunitReporterReporterOptions: {
mochaFile: `reports/junit-mocha-${process.env.MOCHA_GREP}.xml`, mochaFile: `reports/junit-mocha-${process.env.TEST_NAME_PATTERN}.xml`,
includePending: true, includePending: true,
jenkinsMode: true, jenkinsMode: true,
output: true, output: true,
@@ -1,7 +1,7 @@
module.exports = { module.exports = {
reporterEnabled: 'spec, mocha-junit-reporter', reporterEnabled: 'spec, mocha-junit-reporter',
mochaJunitReporterReporterOptions: { mochaJunitReporterReporterOptions: {
mochaFile: `reports/junit-mocha-${process.env.MOCHA_GREP}.xml`, mochaFile: `reports/junit-mocha-${process.env.TEST_NAME_PATTERN}.xml`,
includePending: true, includePending: true,
jenkinsMode: true, jenkinsMode: true,
output: true, output: true,
@@ -1,7 +1,7 @@
module.exports = { module.exports = {
reporterEnabled: 'spec, mocha-junit-reporter', reporterEnabled: 'spec, mocha-junit-reporter',
mochaJunitReporterReporterOptions: { mochaJunitReporterReporterOptions: {
mochaFile: `reports/junit-mocha-${process.env.MOCHA_GREP}.xml`, mochaFile: `reports/junit-mocha-${process.env.TEST_NAME_PATTERN}.xml`,
includePending: true, includePending: true,
jenkinsMode: true, jenkinsMode: true,
output: true, output: true,
@@ -1,7 +1,7 @@
module.exports = { module.exports = {
reporterEnabled: 'spec, mocha-junit-reporter', reporterEnabled: 'spec, mocha-junit-reporter',
mochaJunitReporterReporterOptions: { mochaJunitReporterReporterOptions: {
mochaFile: `reports/junit-mocha-${process.env.MOCHA_GREP}.xml`, mochaFile: `reports/junit-mocha-${process.env.TEST_NAME_PATTERN}.xml`,
includePending: true, includePending: true,
jenkinsMode: true, jenkinsMode: true,
output: true, output: true,
@@ -1,7 +1,7 @@
module.exports = { module.exports = {
reporterEnabled: 'spec, mocha-junit-reporter', reporterEnabled: 'spec, mocha-junit-reporter',
mochaJunitReporterReporterOptions: { mochaJunitReporterReporterOptions: {
mochaFile: `reports/junit-mocha-${process.env.MOCHA_GREP}.xml`, mochaFile: `reports/junit-mocha-${process.env.TEST_NAME_PATTERN}.xml`,
includePending: true, includePending: true,
jenkinsMode: true, jenkinsMode: true,
output: true, output: true,
@@ -1,7 +1,7 @@
module.exports = { module.exports = {
reporterEnabled: 'spec, mocha-junit-reporter', reporterEnabled: 'spec, mocha-junit-reporter',
mochaJunitReporterReporterOptions: { mochaJunitReporterReporterOptions: {
mochaFile: `reports/junit-mocha-${process.env.MOCHA_GREP}.xml`, mochaFile: `reports/junit-mocha-${process.env.TEST_NAME_PATTERN}.xml`,
includePending: true, includePending: true,
jenkinsMode: true, jenkinsMode: true,
output: true, output: true,
@@ -1,7 +1,7 @@
module.exports = { module.exports = {
reporterEnabled: 'spec, mocha-junit-reporter', reporterEnabled: 'spec, mocha-junit-reporter',
mochaJunitReporterReporterOptions: { mochaJunitReporterReporterOptions: {
mochaFile: `reports/junit-mocha-${process.env.MOCHA_GREP}.xml`, mochaFile: `reports/junit-mocha-${process.env.TEST_NAME_PATTERN}.xml`,
includePending: true, includePending: true,
jenkinsMode: true, jenkinsMode: true,
output: true, output: true,
+2 -2
View File
@@ -6,8 +6,8 @@
"type": "module", "type": "module",
"scripts": { "scripts": {
"start": "node app.js", "start": "node app.js",
"test:acceptance": "yarn run test:acceptance:_run -- --grep=$MOCHA_GREP", "test:acceptance": "yarn run test:acceptance:_run -- --grep=$TEST_NAME_PATTERN",
"test:unit": "yarn run test:unit:_run -- --grep=$MOCHA_GREP", "test:unit": "yarn run test:unit:_run -- --grep=$TEST_NAME_PATTERN",
"nodemon": "node --watch app.js", "nodemon": "node --watch app.js",
"test:acceptance:_run": "mocha --recursive --timeout 15000 --exit --retries=$RETRIES $@ test/acceptance/js", "test:acceptance:_run": "mocha --recursive --timeout 15000 --exit --retries=$RETRIES $@ test/acceptance/js",
"test:unit:_run": "mocha --recursive --exit $@ test/unit/js", "test:unit:_run": "mocha --recursive --exit $@ test/unit/js",
+1 -1
View File
@@ -1,7 +1,7 @@
module.exports = { module.exports = {
reporterEnabled: 'spec, mocha-junit-reporter', reporterEnabled: 'spec, mocha-junit-reporter',
mochaJunitReporterReporterOptions: { mochaJunitReporterReporterOptions: {
mochaFile: `reports/junit-mocha-${process.env.MOCHA_GREP}.xml`, mochaFile: `reports/junit-mocha-${process.env.TEST_NAME_PATTERN}.xml`,
includePending: true, includePending: true,
jenkinsMode: true, jenkinsMode: true,
output: true, output: true,
+1 -1
View File
@@ -7,7 +7,7 @@
"scripts": { "scripts": {
"start": "node app.js", "start": "node app.js",
"test:acceptance:_run": "mocha --recursive --timeout 15000 --exit --retries=$RETRIES $@ test/acceptance/js", "test:acceptance:_run": "mocha --recursive --timeout 15000 --exit --retries=$RETRIES $@ test/acceptance/js",
"test:acceptance": "yarn run test:acceptance:_run -- --grep=$MOCHA_GREP", "test:acceptance": "yarn run test:acceptance:_run -- --grep=$TEST_NAME_PATTERN",
"test:unit:_run": "vitest --config ./vitest.config.unit.cjs", "test:unit:_run": "vitest --config ./vitest.config.unit.cjs",
"test:unit": "yarn run test:unit:_run", "test:unit": "yarn run test:unit:_run",
"nodemon": "node --watch app.js", "nodemon": "node --watch app.js",
+1 -1
View File
@@ -1,7 +1,7 @@
module.exports = { module.exports = {
reporterEnabled: 'spec, mocha-junit-reporter', reporterEnabled: 'spec, mocha-junit-reporter',
mochaJunitReporterReporterOptions: { mochaJunitReporterReporterOptions: {
mochaFile: `reports/junit-mocha-${process.env.MOCHA_GREP}.xml`, mochaFile: `reports/junit-mocha-${process.env.TEST_NAME_PATTERN}.xml`,
includePending: true, includePending: true,
jenkinsMode: true, jenkinsMode: true,
output: true, output: true,
+1
View File
@@ -20,6 +20,7 @@ module.exports = defineConfig({
include: ['test/unit/js/**/*.test.{js,ts}'], include: ['test/unit/js/**/*.test.{js,ts}'],
setupFiles: ['./test/unit/setup.js'], setupFiles: ['./test/unit/setup.js'],
isolate: false, isolate: false,
testNamePattern: process.env.TEST_NAME_PATTERN || undefined,
...reporterOptions, ...reporterOptions,
}, },
}) })
+1 -1
View File
@@ -7,7 +7,7 @@
"scripts": { "scripts": {
"start": "node app.js", "start": "node app.js",
"test:acceptance:_run": "mocha --recursive --timeout 15000 --exit --retries=$RETRIES $@ test/acceptance/js", "test:acceptance:_run": "mocha --recursive --timeout 15000 --exit --retries=$RETRIES $@ test/acceptance/js",
"test:acceptance": "yarn run test:acceptance:_run -- --grep=$MOCHA_GREP", "test:acceptance": "yarn run test:acceptance:_run -- --grep=$TEST_NAME_PATTERN",
"test:unit:_run": "vitest --config ./vitest.config.unit.cjs", "test:unit:_run": "vitest --config ./vitest.config.unit.cjs",
"test:unit": "yarn run test:unit:_run", "test:unit": "yarn run test:unit:_run",
"nodemon": "node --watch app.js", "nodemon": "node --watch app.js",
@@ -1,7 +1,7 @@
module.exports = { module.exports = {
reporterEnabled: 'spec, mocha-junit-reporter', reporterEnabled: 'spec, mocha-junit-reporter',
mochaJunitReporterReporterOptions: { mochaJunitReporterReporterOptions: {
mochaFile: `reports/junit-mocha-${process.env.MOCHA_GREP}.xml`, mochaFile: `reports/junit-mocha-${process.env.TEST_NAME_PATTERN}.xml`,
includePending: true, includePending: true,
jenkinsMode: true, jenkinsMode: true,
output: true, output: true,
+1
View File
@@ -20,6 +20,7 @@ module.exports = defineConfig({
include: ['test/unit/js/*.test.{js,ts}'], include: ['test/unit/js/*.test.{js,ts}'],
setupFiles: ['./test/unit/setup.js'], setupFiles: ['./test/unit/setup.js'],
isolate: true, isolate: true,
testNamePattern: process.env.TEST_NAME_PATTERN || undefined,
...reporterOptions, ...reporterOptions,
}, },
}) })
+2 -2
View File
@@ -6,9 +6,9 @@
"scripts": { "scripts": {
"start": "node app.js", "start": "node app.js",
"test:acceptance:_run": "mocha --recursive --timeout 15000 --exit --retries=$RETRIES $@ test/acceptance/js", "test:acceptance:_run": "mocha --recursive --timeout 15000 --exit --retries=$RETRIES $@ test/acceptance/js",
"test:acceptance": "yarn run test:acceptance:_run -- --grep=$MOCHA_GREP", "test:acceptance": "yarn run test:acceptance:_run -- --grep=$TEST_NAME_PATTERN",
"test:unit:_run": "mocha --recursive --exit $@ test/unit/js", "test:unit:_run": "mocha --recursive --exit $@ test/unit/js",
"test:unit": "yarn run test:unit:_run -- --grep=$MOCHA_GREP", "test:unit": "yarn run test:unit:_run -- --grep=$TEST_NAME_PATTERN",
"nodemon": "node --watch app.js", "nodemon": "node --watch app.js",
"benchmark:apply": "node benchmarks/apply", "benchmark:apply": "node benchmarks/apply",
"lint": "eslint --cache --cache-location ../../.cache/eslint/ --max-warnings 0 .", "lint": "eslint --cache --cache-location ../../.cache/eslint/ --max-warnings 0 .",
@@ -1,7 +1,7 @@
module.exports = { module.exports = {
reporterEnabled: 'spec, mocha-junit-reporter', reporterEnabled: 'spec, mocha-junit-reporter',
mochaJunitReporterReporterOptions: { mochaJunitReporterReporterOptions: {
mochaFile: `reports/junit-mocha-${process.env.MOCHA_GREP}.xml`, mochaFile: `reports/junit-mocha-${process.env.TEST_NAME_PATTERN}.xml`,
includePending: true, includePending: true,
jenkinsMode: true, jenkinsMode: true,
output: true, output: true,
+1 -1
View File
@@ -6,7 +6,7 @@
"type": "module", "type": "module",
"scripts": { "scripts": {
"test:acceptance:run": "mocha --recursive --timeout 15000 $@ test/acceptance/js", "test:acceptance:run": "mocha --recursive --timeout 15000 $@ test/acceptance/js",
"test:acceptance": "yarn run test:acceptance:_run -- --grep=$MOCHA_GREP", "test:acceptance": "yarn run test:acceptance:_run -- --grep=$TEST_NAME_PATTERN",
"test:unit:run": "mocha --recursive $@ test/unit/js", "test:unit:run": "mocha --recursive $@ test/unit/js",
"test:unit": "yarn run test:unit:_run", "test:unit": "yarn run test:unit:_run",
"start": "node app.js", "start": "node app.js",
@@ -1,7 +1,7 @@
module.exports = { module.exports = {
reporterEnabled: 'spec, mocha-junit-reporter', reporterEnabled: 'spec, mocha-junit-reporter',
mochaJunitReporterReporterOptions: { mochaJunitReporterReporterOptions: {
mochaFile: `reports/junit-mocha-${process.env.MOCHA_GREP}.xml`, mochaFile: `reports/junit-mocha-${process.env.TEST_NAME_PATTERN}.xml`,
includePending: true, includePending: true,
jenkinsMode: true, jenkinsMode: true,
output: true, output: true,
@@ -20,6 +20,7 @@ module.exports = defineConfig({
include: ['test/unit/js/*.test.{js,ts}'], include: ['test/unit/js/*.test.{js,ts}'],
setupFiles: ['./test/unit/setup.js'], setupFiles: ['./test/unit/setup.js'],
isolate: true, isolate: true,
testNamePattern: process.env.TEST_NAME_PATTERN || undefined,
...reporterOptions, ...reporterOptions,
}, },
}) })
+2 -2
View File
@@ -70,8 +70,8 @@
"start": "node app.js", "start": "node app.js",
"lint": "eslint --cache --cache-location ../../.cache/eslint/ --max-warnings 0 .", "lint": "eslint --cache --cache-location ../../.cache/eslint/ --max-warnings 0 .",
"lint:fix": "eslint --cache --cache-location ../../.cache/eslint/ --fix .", "lint:fix": "eslint --cache --cache-location ../../.cache/eslint/ --fix .",
"test:unit": "yarn run test:unit:_run -- --grep=$MOCHA_GREP", "test:unit": "yarn run test:unit:_run -- --grep=$TEST_NAME_PATTERN",
"test:acceptance": "yarn run test:acceptance:_run -- --grep=$MOCHA_GREP", "test:acceptance": "yarn run test:acceptance:_run -- --grep=$TEST_NAME_PATTERN",
"test:unit:_run": "mocha --recursive --exit $@ test/unit/js", "test:unit:_run": "mocha --recursive --exit $@ test/unit/js",
"test:acceptance:_run": "mocha --recursive --timeout 15000 --exit --retries=$RETRIES $@ test/acceptance/js", "test:acceptance:_run": "mocha --recursive --timeout 15000 --exit --retries=$RETRIES $@ test/acceptance/js",
"nodemon": "node --watch app.js", "nodemon": "node --watch app.js",
@@ -1,7 +1,7 @@
module.exports = { module.exports = {
reporterEnabled: 'spec, mocha-junit-reporter', reporterEnabled: 'spec, mocha-junit-reporter',
mochaJunitReporterReporterOptions: { mochaJunitReporterReporterOptions: {
mochaFile: `reports/junit-mocha-${process.env.MOCHA_GREP}.xml`, mochaFile: `reports/junit-mocha-${process.env.TEST_NAME_PATTERN}.xml`,
includePending: true, includePending: true,
jenkinsMode: true, jenkinsMode: true,
output: true, output: true,
@@ -19,6 +19,7 @@ module.exports = defineConfig({
test: { test: {
include: ['test/acceptance/js/**/*.test.{js,ts}'], include: ['test/acceptance/js/**/*.test.{js,ts}'],
isolate: false, isolate: false,
testNamePattern: process.env.TEST_NAME_PATTERN || undefined,
...reporterOptions, ...reporterOptions,
}, },
}) })
@@ -20,6 +20,7 @@ module.exports = defineConfig({
include: ['test/unit/js/**/*.test.{js,ts}'], include: ['test/unit/js/**/*.test.{js,ts}'],
setupFiles: ['./test/setup.js'], setupFiles: ['./test/setup.js'],
isolate: false, isolate: false,
testNamePattern: process.env.TEST_NAME_PATTERN || undefined,
...reporterOptions, ...reporterOptions,
}, },
}) })
+2 -2
View File
@@ -5,8 +5,8 @@
"main": "app.js", "main": "app.js",
"type": "module", "type": "module",
"scripts": { "scripts": {
"test:acceptance": "yarn run test:acceptance:_run -- --grep=$MOCHA_GREP", "test:acceptance": "yarn run test:acceptance:_run -- --grep=$TEST_NAME_PATTERN",
"test:unit": "yarn run test:unit:_run -- --grep=$MOCHA_GREP", "test:unit": "yarn run test:unit:_run -- --grep=$TEST_NAME_PATTERN",
"start": "node app.js", "start": "node app.js",
"nodemon": "node --watch app.js", "nodemon": "node --watch app.js",
"test:acceptance:_run": "mocha --loader=esmock --recursive --timeout 15000 --exit --retries=$RETRIES $@ test/acceptance/js", "test:acceptance:_run": "mocha --loader=esmock --recursive --timeout 15000 --exit --retries=$RETRIES $@ test/acceptance/js",
@@ -1,7 +1,7 @@
module.exports = { module.exports = {
reporterEnabled: 'spec, mocha-junit-reporter', reporterEnabled: 'spec, mocha-junit-reporter',
mochaJunitReporterReporterOptions: { mochaJunitReporterReporterOptions: {
mochaFile: `reports/junit-mocha-${process.env.MOCHA_GREP}.xml`, mochaFile: `reports/junit-mocha-${process.env.TEST_NAME_PATTERN}.xml`,
includePending: true, includePending: true,
jenkinsMode: true, jenkinsMode: true,
output: true, output: true,
+1 -1
View File
@@ -7,7 +7,7 @@
"scripts": { "scripts": {
"start": "node app.js", "start": "node app.js",
"test:acceptance:_run": "mocha --recursive --timeout 15000 --exit --retries=$RETRIES $@ test/acceptance/js", "test:acceptance:_run": "mocha --recursive --timeout 15000 --exit --retries=$RETRIES $@ test/acceptance/js",
"test:acceptance": "yarn run test:acceptance:_run -- --grep=$MOCHA_GREP", "test:acceptance": "yarn run test:acceptance:_run -- --grep=$TEST_NAME_PATTERN",
"test:unit:_run": "vitest --config ./vitest.config.unit.cjs", "test:unit:_run": "vitest --config ./vitest.config.unit.cjs",
"test:unit": "yarn run test:unit:_run", "test:unit": "yarn run test:unit:_run",
"nodemon": "node --watch app.js", "nodemon": "node --watch app.js",
@@ -1,7 +1,7 @@
module.exports = { module.exports = {
reporterEnabled: 'spec, mocha-junit-reporter', reporterEnabled: 'spec, mocha-junit-reporter',
mochaJunitReporterReporterOptions: { mochaJunitReporterReporterOptions: {
mochaFile: `reports/junit-mocha-${process.env.MOCHA_GREP}.xml`, mochaFile: `reports/junit-mocha-${process.env.TEST_NAME_PATTERN}.xml`,
includePending: true, includePending: true,
jenkinsMode: true, jenkinsMode: true,
output: true, output: true,
@@ -20,6 +20,7 @@ module.exports = defineConfig({
include: ['test/unit/js/**/*.test.{js,ts}'], include: ['test/unit/js/**/*.test.{js,ts}'],
setupFiles: ['./test/unit/setup.js'], setupFiles: ['./test/unit/setup.js'],
isolate: false, isolate: false,
testNamePattern: process.env.TEST_NAME_PATTERN || undefined,
...reporterOptions, ...reporterOptions,
}, },
}) })
+6 -6
View File
@@ -46,7 +46,7 @@ make test_unit
During development it is often useful to only run a subset of tests, which can be configured with arguments to the mocha CLI: During development it is often useful to only run a subset of tests, which can be configured with arguments to the mocha CLI:
``` ```
make test_unit MOCHA_GREP='AuthorizationManager' make test_unit TEST_NAME_PATTERN='AuthorizationManager'
``` ```
To run only the unit tests for a single module do: To run only the unit tests for a single module do:
@@ -55,10 +55,10 @@ To run only the unit tests for a single module do:
make test_unit_module MODULE=saas-authentication make test_unit_module MODULE=saas-authentication
``` ```
Module tests can also use a MOCHA_GREP argument: Module tests can also use a TEST_NAME_PATTERN argument:
``` ```
make test_unit_module MODULE=saas-authentication MOCHA_GREP=SSO make test_unit_module MODULE=saas-authentication TEST_NAME_PATTERN=SSO
``` ```
### Acceptance Tests ### Acceptance Tests
@@ -84,7 +84,7 @@ make test_acceptance_app_stop_service
During development it is often useful to only run a subset of tests, which can be configured with arguments to the mocha CLI: During development it is often useful to only run a subset of tests, which can be configured with arguments to the mocha CLI:
``` ```
make test_acceptance_run MOCHA_GREP='AuthorizationManager' make test_acceptance_run TEST_NAME_PATTERN='AuthorizationManager'
``` ```
To run only the acceptance tests for a single module do: To run only the acceptance tests for a single module do:
@@ -93,10 +93,10 @@ To run only the acceptance tests for a single module do:
make test_acceptance_module MODULE=saas-authentication make test_acceptance_module MODULE=saas-authentication
``` ```
Module tests can also use a MOCHA_GREP argument: Module tests can also use a TEST_NAME_PATTERN argument:
``` ```
make test_acceptance_module MODULE=saas-authentication MOCHA_GREP=SSO make test_acceptance_module MODULE=saas-authentication TEST_NAME_PATTERN=SSO
``` ```
## Routes ## Routes
@@ -54,7 +54,7 @@ Unit tests for the parser live in `web/test/unit/src/LezerLatex`. There are thre
These tests run as part of `test_frontend`. You can run these tests alone by invoking: These tests run as part of `test_frontend`. You can run these tests alone by invoking:
```sh ```sh
make test_unit MOCHA_GREP='lezer-latex' make test_unit TEST_NAME_PATTERN='lezer-latex'
``` ```
## Trying the parser ## Trying the parser
+2 -2
View File
@@ -14,7 +14,7 @@
"test:acceptance:run_dir": "bin/test_acceptance_run_dir", "test:acceptance:run_dir": "bin/test_acceptance_run_dir",
"test:acceptance:app": "yarn run test:acceptance:run_dir -- test/acceptance/src", "test:acceptance:app": "yarn run test:acceptance:run_dir -- test/acceptance/src",
"test:acceptance:app:debug": "yarn run test:acceptance:debug:run_dir -- test/acceptance/src", "test:acceptance:app:debug": "yarn run test:acceptance:debug:run_dir -- test/acceptance/src",
"test:acceptance:debug:run_dir": "mocha --recursive --timeout 25000 --grep=${MOCHA_GREP:-} --require test/acceptance/bootstrap.js --inspect=0.0.0.0:19999 --inspect-brk", "test:acceptance:debug:run_dir": "mocha --recursive --timeout 25000 --grep=${TEST_NAME_PATTERN:-} --require test/acceptance/bootstrap.js --inspect=0.0.0.0:19999 --inspect-brk",
"test:unit:run_dir": "bin/test_unit_run_dir", "test:unit:run_dir": "bin/test_unit_run_dir",
"test:unit:all": "yarn run test:unit:run_dir test/unit/src modules/*/test/unit/src", "test:unit:all": "yarn run test:unit:run_dir test/unit/src modules/*/test/unit/src",
"test:unit:all:silent": "yarn run test:unit:all --reporter dot", "test:unit:all:silent": "yarn run test:unit:all --reporter dot",
@@ -23,7 +23,7 @@
"test:unit:parallel": "vitest run --project=Parallel", "test:unit:parallel": "vitest run --project=Parallel",
"test:unit:sequential": "vitest run --project=Sequential", "test:unit:sequential": "vitest run --project=Sequential",
"test:unit:watch": "vitest", "test:unit:watch": "vitest",
"test:frontend": "NODE_ENV=test TZ=GMT mocha --recursive --timeout 5000 --exit --extension js,jsx,mjs,ts,tsx --grep=${MOCHA_GREP:-} --require test/frontend/bootstrap.js --ignore '**/*.spec.{js,jsx,ts,tsx}' --ignore '**/helpers/**/*.{js,jsx,ts,tsx}' test/frontend modules/*/test/frontend", "test:frontend": "NODE_ENV=test TZ=GMT mocha --recursive --timeout 5000 --exit --extension js,jsx,mjs,ts,tsx --grep=${TEST_NAME_PATTERN:-} --require test/frontend/bootstrap.js --ignore '**/*.spec.{js,jsx,ts,tsx}' --ignore '**/helpers/**/*.{js,jsx,ts,tsx}' test/frontend modules/*/test/frontend",
"test:frontend:coverage": "c8 --all --include 'frontend/js' --include 'modules/*/frontend/js' --exclude 'frontend/js/vendor' --reporter=lcov --reporter=text-summary yarn run test:frontend", "test:frontend:coverage": "c8 --all --include 'frontend/js' --include 'modules/*/frontend/js' --exclude 'frontend/js/vendor' --reporter=lcov --reporter=text-summary yarn run test:frontend",
"test:writefull": "vitest --run --config modules/writefull/frontend/js/integration/vitest.config.ts", "test:writefull": "vitest --run --config modules/writefull/frontend/js/integration/vitest.config.ts",
"start": "node app.mjs", "start": "node app.mjs",
+1
View File
@@ -25,6 +25,7 @@ module.exports = defineConfig({
globals: false, globals: false,
isolate: false, isolate: false,
passWithNoTests: true, // in case there are no tests from one project or other in a module passWithNoTests: true, // in case there are no tests from one project or other in a module
testNamePattern: process.env.TEST_NAME_PATTERN || undefined,
projects: [ projects: [
{ {
extends: true, extends: true,