Skip to content

Conversation

@sukima
Copy link
Contributor

@sukima sukima commented Sep 12, 2025

Prior to this change, we only supported an array for the dataset type which causes the original qunit type definitions to resolve if the dataset is an object. The fallback will result in the TestContect being removed from the this and marking it as any.

According the QUnit docs if you pass an object instead of an array to test.each() the keys of the object become the test label while the values are the data passed to each run of the test.

This change unions the T[] with Record<string, T> so that both options can be used as expected.

Prior to this change, we only supported an array for the dataset type
which causes the original `qunit` type definitions to resolve if the
dataset is an object. The fallback will result in the `TestContect`
being removed from the `this` and marking it as `any`.

According the QUnit docs if you pass an object instead of an array to
test.each() the keys of the object become the test label while the
values are the data passed to each run of the test.

This change unions the T[] with Record<string, T> so that both options
can be used as expected.
@NullVoxPopuli
Copy link
Collaborator

gonna toggle the PR to trick CI in to running

@NullVoxPopuli NullVoxPopuli reopened this Sep 12, 2025
@NullVoxPopuli NullVoxPopuli merged commit 3e02eba into emberjs:main Sep 12, 2025
26 checks passed
@github-actions github-actions bot mentioned this pull request Sep 12, 2025
@sukima sukima deleted the test-each-dataset-type-fix branch September 12, 2025 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants