Skip to content

Commit f3f357c

Browse files
committed
Rename testing directories and scripts
- Rename /tests/ directory to /test/ - Rename script/task names by removing “jest” identifier - Remove “test:jest-examples” script
1 parent 4be2845 commit f3f357c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+42
-44
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ jobs:
2828
- name: bootstrap
2929
run: npm run bootstrap
3030
- name: unit tests
31-
run: npm run test:jest-unit -- -ci
31+
run: npm run test:unit -- -ci
3232
- name: integration tests
33-
run: npm run test:jest-integration -- -ci
33+
run: npm run test:integration -- -ci
3434
- uses: microsoft/playwright-github-action@v1.3.0
3535
- name: e2e tests
36-
run: npm run test:jest-e2e -- --ci
36+
run: npm run test:e2e -- --ci
3737
- name: Upload artifacts (diff output)
3838
uses: actions/upload-artifact@v2
3939
if: failure()
4040
with:
4141
name: ${{ matrix.os }}-${{ matrix.node-version }}-diff-output
42-
path: ${{ github.workspace }}/tests/**/__diff_output__/*
42+
path: ${{ github.workspace }}/test/**/__diff_output__/*

.vscode/launch.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
"request": "launch",
1010
"name": "Run tests",
1111
"runtimeExecutable": "npm",
12-
"runtimeArgs": ["run-script", "test:jest"],
12+
"runtimeArgs": ["run-script", "test"],
1313
"console": "integratedTerminal"
1414
},
1515
{
1616
"type": "node",
1717
"request": "launch",
1818
"name": "Run current test file",
1919
"runtimeExecutable": "npm",
20-
"runtimeArgs": ["run-script", "test:jest"],
20+
"runtimeArgs": ["run-script", "test"],
2121
"args": ["--", "-i", "${relativeFile}", "--testPathIgnorePatterns"],
2222
"console": "integratedTerminal"
2323
},
@@ -26,7 +26,7 @@
2626
"request": "launch",
2727
"name": "Run selected test name",
2828
"runtimeExecutable": "npm",
29-
"runtimeArgs": ["run-script", "test:jest"],
29+
"runtimeArgs": ["run-script", "test"],
3030
"args": [
3131
"--",
3232
"-i",
@@ -42,7 +42,7 @@
4242
"request": "launch",
4343
"name": "Update current test file snapshot(s)",
4444
"runtimeExecutable": "npm",
45-
"runtimeArgs": ["run-script", "test:jest"],
45+
"runtimeArgs": ["run-script", "test"],
4646
"args": [
4747
"--",
4848
"-i",
@@ -57,7 +57,7 @@
5757
"request": "launch",
5858
"name": "Update selected test name snapshot(s)",
5959
"runtimeExecutable": "npm",
60-
"runtimeArgs": ["run-script", "test:jest"],
60+
"runtimeArgs": ["run-script", "test"],
6161
"args": [
6262
"--",
6363
"-i",

jest.config.js

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const path = require('path');
2-
const { TEST_URL, DOCS_URL, LIB_URL } = require('./tests/e2e/config/server.js');
2+
const { TEST_URL, DOCS_URL, LIB_URL } = require('./test/e2e/config/server.js');
33

44
const sharedConfig = {
55
errorOnDeprecated: true,
@@ -13,40 +13,39 @@ const sharedConfig = {
1313
},
1414
resetModules: true,
1515
restoreMocks: true,
16-
// testPathIgnorePatterns: ['example.test'],
1716
};
1817

1918
// Jest-Playwrigth Config
2019
process.env.JEST_PLAYWRIGHT_CONFIG =
21-
'./tests/e2e/config/jest-playwright.config.js';
20+
'./test/e2e/config/jest-playwright.config.js';
2221

2322
module.exports = {
2423
projects: [
2524
// Unit Tests (Jest)
2625
{
2726
...sharedConfig,
2827
displayName: 'unit',
29-
setupFilesAfterEnv: ['<rootDir>/tests/unit/config/jest.setup-tests.js'],
30-
testMatch: ['<rootDir>/tests/unit/*.test.js'],
28+
setupFilesAfterEnv: ['<rootDir>/test/unit/config/jest.setup-tests.js'],
29+
testMatch: ['<rootDir>/test/unit/*.test.js'],
3130
testURL: TEST_URL,
3231
},
3332
// Integration Tests (Jest)
3433
{
3534
...sharedConfig,
3635
displayName: 'integration',
37-
setupFilesAfterEnv: ['<rootDir>/tests/unit/config/jest.setup-tests.js'],
38-
testMatch: ['<rootDir>/tests/integration/*.test.js'],
36+
setupFilesAfterEnv: ['<rootDir>/test/unit/config/jest.setup-tests.js'],
37+
testMatch: ['<rootDir>/test/integration/*.test.js'],
3938
testURL: TEST_URL,
4039
},
4140
// E2E Tests (Jest + Playwright)
4241
{
4342
...sharedConfig,
4443
displayName: 'e2e',
45-
globalSetup: './tests/e2e/config/jest.setup.js',
46-
globalTeardown: './tests/e2e/config/jest.teardown.js',
44+
globalSetup: './test/e2e/config/jest.setup.js',
45+
globalTeardown: './test/e2e/config/jest.teardown.js',
4746
preset: 'jest-playwright-preset',
48-
setupFilesAfterEnv: ['<rootDir>/tests/e2e/config/jest.setup-tests.js'],
49-
testMatch: ['<rootDir>/tests/e2e/*.test.js'],
47+
setupFilesAfterEnv: ['<rootDir>/test/e2e/config/jest.setup-tests.js'],
48+
testMatch: ['<rootDir>/test/e2e/*.test.js'],
5049
},
5150
],
5251
};

package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,10 @@
2828
"dev:ssr": "run-p serve:ssr watch:*",
2929
"lint": "eslint .",
3030
"fixlint": "eslint . --fix",
31-
"test:jest": "jest",
32-
"test:jest-e2e": "jest --selectProjects e2e",
33-
"test:jest-examples": "jest -i ./tests/**/example.test.js --testPathIgnorePatterns",
34-
"test:jest-integration": "jest --selectProjects integration",
35-
"test:jest-unit": "jest --selectProjects unit",
31+
"test": "jest",
32+
"test:e2e": "jest --selectProjects e2e",
33+
"test:integration": "jest --selectProjects integration",
34+
"test:unit": "jest --selectProjects unit",
3635
"css": "node build/css",
3736
"watch:css": "npm run css -- -o themes -w",
3837
"watch:js": "node build/build.js",
File renamed without changes.

tests/README.md renamed to test/README.md

Lines changed: 19 additions & 19 deletions
File renamed without changes.

0 commit comments

Comments
 (0)