Skip to content

Commit

Permalink
chore(web): rename test files and folders
Browse files Browse the repository at this point in the history
This change renames the test files according to the discussion at the
Keyman conference in November 2024. It also renames some folders from
`test` to `tests`.
  • Loading branch information
ermshiperete committed Nov 26, 2024
1 parent 09dc2e0 commit 607d055
Show file tree
Hide file tree
Showing 117 changed files with 38 additions and 39 deletions.
4 changes: 2 additions & 2 deletions web/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ fi

builder_describe_outputs \
configure "/node_modules" \
build "/web/build/test/dom/cases/attachment/outputTargetForElement.spec.html" \
build "/web/build/test/dom/cases/attachment/outputTargetForElement.tests.html" \
build:app/browser "/web/build/app/browser/lib/index.mjs" \
build:app/webview "/web/build/app/webview/${config}/keymanweb-webview.js" \
build:app/ui "/web/build/app/ui/${config}/kmwuitoggle.js" \
Expand Down Expand Up @@ -127,7 +127,7 @@ build_action() {
precompile "${dir}"
done

cp "${KEYMAN_ROOT}/web/src/test/auto/dom/cases/attachment/outputTargetForElement.spec.html" \
cp "${KEYMAN_ROOT}/web/src/test/auto/dom/cases/attachment/outputTargetForElement.tests.html" \
"${KEYMAN_ROOT}/web/build/test/dom/cases/attachment/"
}

Expand Down
2 changes: 1 addition & 1 deletion web/src/engine/common/web-utils/.c8rc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"src/deviceSpec.ts",
"src/globalObject.ts",
"node_modules/*",
"src/test"
"src/tests/*"
],
"exclude-after-remap": true,
"reporter": ["text", "text-summary"],
Expand Down
1 change: 0 additions & 1 deletion web/src/engine/common/web-utils/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ dist/

# Other local files.
node_modules/
unit_tests/modernizr.js
source/environment.inc.ts
**/.idea/**/*.xml
**/*.iml
Expand Down
2 changes: 1 addition & 1 deletion web/src/engine/common/web-utils/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function do_test() {
FLAGS="$FLAGS --reporter mocha-teamcity-reporter"
fi

c8 mocha --recursive $FLAGS ./src/test/
c8 mocha --recursive $FLAGS ./src/tests/
}

builder_run_action configure verify_npm_setup
Expand Down
2 changes: 1 addition & 1 deletion web/src/engine/common/web-utils/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
"src/*.ts"
],
"exclude": [
"src/test/**/*.js"
"src/tests/**/*.js"
]
}
2 changes: 1 addition & 1 deletion web/src/engine/predictive-text/templates/.c8rc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"clean": true,
"exclude": [
"node_modules/**",
"test/**"
"tests/**"
],
"exclude-after-remap": true,
"reporter": ["text", "text-summary"],
Expand Down
2 changes: 1 addition & 1 deletion web/src/engine/predictive-text/templates/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

"type": "module",
"directories": {
"test": "test"
"test": "tests"
},
"files": [
"index.js"
Expand Down
2 changes: 1 addition & 1 deletion web/src/engine/predictive-text/templates/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
"src/**/*.ts"
],
"exclude": [
"test"
"tests"
]
}
2 changes: 1 addition & 1 deletion web/src/engine/predictive-text/wordbreakers/.c8rc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"clean": true,
"exclude": [
"node_modules/*",
"test"
"tests"
],
"exclude-after-remap": true,
"reporter": ["text", "text-summary"],
Expand Down
2 changes: 1 addition & 1 deletion web/src/engine/predictive-text/wordbreakers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
},
"directories": {
"lib": "lib",
"test": "test"
"test": "tests"
},
"files": [
"lib"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default {
concurrency: 10,
nodeResolve: true,
files: [
'**/*.spec.ts'
'**/*.tests.ts'
],
middleware: [
// Rewrites short-hand paths for test resources, making them fully relative to the repo root.
Expand Down
2 changes: 1 addition & 1 deletion web/src/engine/predictive-text/worker-thread/.c8rc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"check-coverage": false,
"clean": true,
"exclude": [
"src/test/**",
"src/tests/**",
"node_modules/*"
],
"exclude-after-remap": true,
Expand Down
4 changes: 2 additions & 2 deletions web/src/engine/predictive-text/worker-thread/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ function do_test() {
WTR_DEBUG=" --manual"
fi

c8 mocha --recursive $MOCHA_FLAGS ./src/test/mocha/cases/
c8 mocha --recursive $MOCHA_FLAGS ./src/tess/mocha/cases/

web-test-runner --config ./src/test/test-runner/web-test-runner${WTR_CONFIG}.config.mjs ${WTR_DEBUG}
web-test-runner --config ./src/tests/test-runner/web-test-runner${WTR_CONFIG}.config.mjs ${WTR_DEBUG}
}

builder_run_action configure do_configure
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default {
concurrency: 10,
nodeResolve: true,
files: [
'**/*.spec.ts'
'**/*.tests.ts'
],
middleware: [
// Rewrites short-hand paths for test resources, making them fully relative to the repo root.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
import { runTests } from '@web/test-runner-mocha';

runTests(async() => {
await import('./canary.spec.ts');
await import('./ignoredInputs.spec.ts');
await import('./recordedCoordSequences.spec.ts');
await import('./canary.tests.ts');
await import('./ignoredInputs.tests.ts');
await import('./recordedCoordSequences.tests.ts');
});
</script>
</head>
Expand Down
File renamed without changes.
24 changes: 12 additions & 12 deletions web/src/test/auto/dom/web-test-runner.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -33,53 +33,53 @@ export default {
nodeResolve: true,
// Top-level, implicit 'default' group
files: [
'src/test/auto/dom/test_init_check.spec.ts',
// '**/*.spec.html'
'src/test/auto/dom/init_check.tests.ts',
// '**/*.tests.html'
],
groups: [
{
name: 'engine/attachment',
// Relative, from the containing package.json
files: [
'build/test/dom/cases/attachment/**/*.spec.html',
'build/test/dom/cases/attachment/**/*.spec.mjs'
'build/test/dom/cases/attachment/**/*.tests.html',
'build/test/dom/cases/attachment/**/*.tests.mjs'
]
},
{
name: 'app/browser',
// Relative, from the containing package.json
files: ['build/test/dom/cases/browser/**/*.spec.mjs']
files: ['build/test/dom/cases/browser/**/*.tests.mjs']
},
{
name: 'engine/dom-utils',
// Relative, from the containing package.json
files: ['build/test/dom/cases/dom-utils/**/*.spec.mjs']
files: ['build/test/dom/cases/dom-utils/**/*.tests.mjs']
},
{
name: 'engine/element-wrappers',
// Relative, from the containing package.json
files: ['build/test/dom/cases/element-wrappers/**/*.spec.mjs']
files: ['build/test/dom/cases/element-wrappers/**/*.tests.mjs']
},
{
name: 'engine/gesture-processor',
// Relative, from the containing package.json
// Note: here we use the .spec.html file in the src directory!
files: ['src/test/auto/dom/cases/gesture-processor/**/*.spec.html']
// Note: here we use the .tests.html file in the src directory!
files: ['src/test/auto/dom/cases/gesture-processor/**/*.tests.html']
},
{
name: 'engine/keyboard',
// Relative, from the containing package.json
files: ['build/test/dom/cases/keyboard/**/*.spec.mjs']
files: ['build/test/dom/cases/keyboard/**/*.tests.mjs']
},
{
name: 'engine/keyboard-storage',
// Relative, from the containing package.json
files: ['build/test/dom/cases/keyboard-storage/**/*.spec.mjs']
files: ['build/test/dom/cases/keyboard-storage/**/*.tests.mjs']
},
{
name: 'engine/osk',
// Relative, from the containing package.json
files: ['build/test/dom/cases/osk/**/*.spec.mjs']
files: ['build/test/dom/cases/osk/**/*.tests.mjs']
}
],
middleware: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
MultitapModel,
SimpleTapModel,
SubkeySelectModel
} from './isolatedGestureSpecs.js';
} from './isolatedGestureSpec.js';

import {
FlickEndThreshold,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
MultitapModel,
SimpleTapModel,
SubkeySelectModel
} from './isolatedGestureSpecs.js';
} from './isolatedGestureSpec.js';

const TestGestureModelDefinitions: GestureModelDefs<string> = {
gestures: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
MultitapModel,
SimpleTapModel,
SubkeySelectModel
} from './isolatedGestureSpecs.js';
} from './isolatedGestureSpec.js';

const TestGestureModelDefinitions: GestureModelDefs<string> = {
gestures: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
MultitapModel,
SimpleTapModel,
SubkeySelectModel
} from './isolatedGestureSpecs.js';
} from './isolatedGestureSpec.js';

import {
LongpressDistanceThreshold
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
MultitapModel,
SimpleTapModel,
SubkeySelectModel
} from './isolatedGestureSpecs.js';
} from './isolatedGestureSpec.js';

const LongpressDurationThreshold = LongpressModel.contacts[0].model.timer.duration;

Expand Down
6 changes: 3 additions & 3 deletions web/src/test/auto/integrated/web-test-runner.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ export default {
new LauncherWrapper(playwrightLauncher({ product: 'firefox' })),
// Setting it higher makes things faster... but Webkit experiences stability
// issues for some of the tests if this is set higher than 1. Notably,
// engine.spec.mjs, events.spec.mjs, and text_selection.spec.mjs. All the
// engine.tests.mjs, events.tests.mjs, and text_selection.tests.mjs. All the
// text-simulation ones.
new LauncherWrapper(playwrightLauncher({ product: 'webkit', concurrency: 1}))
],
concurrency: 10,
nodeResolve: true,
files: [
'build/test/integrated//**/*.spec.mjs',
// '**/*.spec.html'
'build/test/integrated//**/*.tests.mjs',
// '**/*.tests.html'
],
middleware: [
// Rewrites short-hand paths for test resources, making them fully relative to the repo root.
Expand Down

0 comments on commit 607d055

Please sign in to comment.