-
-
Notifications
You must be signed in to change notification settings - Fork 133
maint(web): re-add engine .js tests 🎼 #15497
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: epic/web-core
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -8,8 +8,15 @@ export { | |||||||||||||||||||||||||||
| REGION_CODES | ||||||||||||||||||||||||||||
| } from './keyboardStub.js'; | ||||||||||||||||||||||||||||
| export { StubAndKeyboardCache, toPrefixedKeyboardId, toUnprefixedKeyboardId } from './stubAndKeyboardCache.js'; | ||||||||||||||||||||||||||||
| export { CloudQueryResult, CloudQueryEngine } from './cloud/queryEngine.js'; | ||||||||||||||||||||||||||||
| export { CloudQueryResult, CloudQueryEngine } from './cloud/cloudQueryEngine.js'; | ||||||||||||||||||||||||||||
| export { CloudRequesterInterface } from './cloud/requesterInterface.js'; | ||||||||||||||||||||||||||||
| export { KeyboardRequisitioner } from './keyboardRequisitioner.js'; | ||||||||||||||||||||||||||||
| export { ModelCache } from './modelCache.js'; | ||||||||||||||||||||||||||||
| export { DOMCloudRequester } from './domCloudRequester.js'; | ||||||||||||||||||||||||||||
| export { DOMCloudRequester } from './domCloudRequester.js'; | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| import { CLOUD_TIMEOUT_ERR, CLOUD_STUB_REGISTRATION_ERR } from './cloud/cloudQueryEngine.js'; | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| export const unitTestEndpoints = { | ||||||||||||||||||||||||||||
| CLOUD_TIMEOUT_ERR, | ||||||||||||||||||||||||||||
| CLOUD_STUB_REGISTRATION_ERR | ||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||
|
Comment on lines
+17
to
+22
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't feel right. keyman/web/src/test/auto/resources/loader/nodeCloudRequester.ts Lines 35 to 38 in 9930a8c
keyman/web/src/test/auto/resources/loader/nodeCloudRequester.ts Lines 58 to 60 in 9930a8c
IMHO, those errors should just be plain strings in the unit testing code -- it's not deployed, there's no localization need, etc, etc. Just KISS. We can then eliminate the messiness of exporting these two constants.
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, inlined those consts. |
||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,18 +6,22 @@ const require = createRequire(import.meta.url); | |
|
|
||
| import { MinimalKeymanGlobal } from 'keyman/engine/keyboard'; | ||
| import { JSKeyboardInterface } from 'keyman/engine/js-processor'; | ||
| import { NodeKeyboardLoader } from '../../../resources/loader/nodeKeyboardLoader.js'; | ||
| import { NodeKeyboardLoader } from 'keyman/test/resources'; | ||
| import { KeyboardTest, NodeProctor } from '@keymanapp/recorder-core'; | ||
|
|
||
| import { env } from 'node:process'; | ||
| const KEYMAN_ROOT = env.KEYMAN_ROOT; | ||
| import { fileURLToPath } from 'node:url'; | ||
| import { dirname } from 'node:path'; | ||
|
|
||
| const __dirname = dirname(fileURLToPath(import.meta.url)); | ||
| const KEYMAN_ROOT = env.KEYMAN_ROOT ?? (__dirname + '/../../../../../../../../'); | ||
|
Comment on lines
12
to
+17
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we put this into a helper module in keyman/test/resources and avoid repeating it? |
||
|
|
||
| describe('Engine - Unmatched Final Groups', function() { | ||
| let testJSONtext = fs.readFileSync(require.resolve('@keymanapp/common-test-resources/json/engine_tests/ghp_enter.json')); | ||
| // Common test suite setup. | ||
| let testSuite = new KeyboardTest(JSON.parse(testJSONtext)); | ||
|
|
||
| var keyboardWithHarness; | ||
| let keyboardWithHarness; | ||
| let device = { | ||
| formFactor: 'desktop', | ||
| OS: 'windows', | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem right. We are running code coverage tests elsewhere just fine.