-
-
Notifications
You must be signed in to change notification settings - Fork 120
test(developer): add test to kmc-analyze for Warn_PreviousMapFileCouldNotBeLoaded #14038
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: master
Are you sure you want to change the base?
Conversation
User Test ResultsTest specification and instructions ERROR: user tests have not yet been defined |
This pull request is from an external repo and will not automatically be built. The build must still be passed before it can be merged. Ask one of the team members to make a manual build of this PR. |
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.
Thank you for the PR!
Unfortunately this is not quite what we are looking for in testing the messages. What we want to test is that the analyzer itself generates the message when given a relevant input (the message infrastructure itself is tested in the verifyCompilerMessagesObject call). So you could look at some of the other message tests in other kmc modules to see the pattern, for example see kmc-copy:
keyman/developer/src/kmc-copy/test/copier-messages.tests.ts
Lines 33 to 38 in ba8e5dc
it('should generate ERROR_InvalidKeyboardId if the output keyboard id is invalid', async function() { | |
const copier = new KeymanProjectCopier(); | |
assert.isTrue(await copier.init(callbacks, {dryRun: true, outPath: '0invalid'})) | |
assert.isNull(await copier.run('cloud:jawa')); | |
assert.isTrue(callbacks.hasMessage(CopierMessages.ERROR_InvalidKeyboardId)); | |
}); |
We don't yet have a docker image for building Developer, which would simplify this for sure. @ermshiperete what do you think? Shouldn't be too hard to do because the build scripts already run on Linux, so probably could start from the Web docker image? |
Thanks for the detailed feedback! That makes sense. I'll try to fix my local compatibility issues with Node.js and my Ubuntu (24) sytem first ... |
Hi! I tried to follow your suggestion and base the test on Many greetings. |
Yes, it is an internal package, part of the keyman npm workspace --> developer/src/common/web/test-helpers/package.json. It should resolve automatically if added to the kmc-analyze package.json. |
Summary
This PR adds a unit test for the
Warn_PreviousMapFileCouldNotBeLoaded
message inAnalyzerMessages
.Context
This is related to the "good first issue" about low test coverage in
developer/src/kmc-analyze
.I couldn't run the tests locally on Linux due to Node.js + ESM + ts-node compatibility issues, but I followed the project's existing patterns closely. Feedback welcome!