Skip to content

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

Merged
Krinkle merged 1 commit intoqunitjs:mainfrom
Krinkle:each-auto-label
Sep 8, 2024
Merged

Core: Add automatic labels in test.each() for primitive values in arrays#1799
Krinkle merged 1 commit intoqunitjs:mainfrom
Krinkle:each-auto-label

Conversation

@Krinkle
Copy link
Copy Markdown
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
Copy Markdown
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!

Fixes qunitjs#1733.

Co-authored-by: Vivien Tintillier <vtintillier.privatedev@gmail.com>
@Krinkle Krinkle merged commit bf42d2b into qunitjs:main Sep 8, 2024
@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