Skip to content
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

Core: Add automatic labels in test.each() for primitive values in arrays #1799

Merged
merged 1 commit into from
Sep 8, 2024

Conversation

Krinkle
Copy link
Member

@Krinkle Krinkle commented Sep 5, 2024

Fixes #1733.

Before

TAP version 13
ok 1 array of strings [0]
ok 2 array of strings [1]
ok 3 array of strings [2]
ok 4 array of strings [3]

ok 13 array of mixed [0]
ok 14 array of mixed [1]
ok 15 array of mixed [2]
ok 16 array of mixed [3]
ok 17 array of mixed [4]
ok 18 array of mixed [5]
ok 19 array of mixed [6]
ok 20 array of mixed [7]
ok 21 array of mixed [8]
ok 22 array of mixed [9]
ok 23 array of mixed [10]

ok 27 keyed objects [caseFoo]
ok 28 keyed objects [caseBar]

After

TAP version 13
ok 1 array of strings [foo]
ok 2 array of strings [xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx]
ok 3 array of strings [$]
ok 4 array of strings [http://example.org]

ok 13 array of mixed [0: undefined]
ok 14 array of mixed [1: null]
ok 15 array of mixed [2: false]
ok 16 array of mixed [3: true]
ok 17 array of mixed [4: 0]
ok 18 array of mixed [5: 1]
ok 19 array of mixed [6: -10]
ok 20 array of mixed [7: 3.3333333333333335]
ok 21 array of mixed [8: 1e+43]
ok 22 array of mixed [9: Infinity]
ok 23 array of mixed [10: NaN]

ok 27 keyed objects [caseFoo]
ok 28 keyed objects [caseBar]

\cc @vtintillier

Copy link
Contributor

@vtintillier vtintillier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks a lot!

test/cli/fixtures/each-array-labels.js Show resolved Hide resolved
test/cli/fixtures/each-array-labels.tap.txt Show resolved Hide resolved
@Krinkle Krinkle merged commit bf42d2b into qunitjs:main Sep 8, 2024
21 checks passed
@Krinkle Krinkle deleted the each-auto-label branch September 8, 2024 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Let simple array data in test.each() serve as automatic labels
2 participants