Skip to content

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

Open
alihcsumer wants to merge 1 commit into
masterfrom
wtf/fixunittestimports
Open

[WTF-2710]: Fix unit tests failing on ValueStatus import#191
alihcsumer wants to merge 1 commit 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.

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.

3 participants