Skip to content

[WTF-2710]: Fix unit tests failing on ValueStatus import#191

Merged
mlaponder merged 6 commits into
masterfrom
wtf/fixunittestimports
Jul 16, 2026
Merged

[WTF-2710]: Fix unit tests failing on ValueStatus import#191
mlaponder merged 6 commits into
masterfrom
wtf/fixunittestimports

Conversation

@alihcsumer

Copy link
Copy Markdown
Contributor

Checklist

  • Contains unit tests ❌
  • Contains breaking changes ❌
  • Did you update version and changelog? ❌

This PR contains

  • Bug fix

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."

@alihcsumer alihcsumer requested a review from a team as a code owner July 6, 2026 08:35
@weirdwater weirdwater changed the title [WTF-2710] Fix unit tests failing on ValueStatus import [WTF-2710]: Fix unit tests failing on ValueStatus import Jul 6, 2026
@weirdwater

Copy link
Copy Markdown
Collaborator

I like the approach proposed in !192 better, since it follows a pattern we already use for mocking other parts of the mendix package.

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.

Comment thread packages/pluggable-widgets-tools/package.json Outdated
Comment thread packages/pluggable-widgets-tools/CHANGELOG.md Outdated
@mlaponder mlaponder merged commit d2c17a2 into master Jul 16, 2026
7 checks passed
@mlaponder mlaponder deleted the wtf/fixunittestimports branch July 16, 2026 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants