[WTF-2710]: Fix unit tests failing on ValueStatus import#191
Open
alihcsumer wants to merge 1 commit into
Open
Conversation
Collaborator
|
I like the approach proposed in !192 better, since it follows a pattern we already use for mocking other parts of the Additionally I would ask to add some form of type checking. In this example the mocked enum is checked for completeness. This will throw an error when the mock misses a member. export const FormatterType: { [t in keyof typeof mendix.FormatterType]: string } = {
Number: "number",
DateTime: "datetime",
}I tried to check for both completeness and consistency, but I was not able to index over the enum without importing the value. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist
This PR contains
What is the purpose of this PR?
...
Relevant changes
Unit tests run via pluggable-widgets-tools test:unit:web fail to load any test suite whose module graph imports a runtime value from the mendix package.
The suite errors out before any test runs with "This package should not be used in the runtime."