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

Upgrade to TAP 14 - support for subtests, maybe indentation? #588

Open
tristanhoy opened this issue Dec 23, 2022 · 1 comment
Open

Upgrade to TAP 14 - support for subtests, maybe indentation? #588

tristanhoy opened this issue Dec 23, 2022 · 1 comment

Comments

@tristanhoy
Copy link

TAP 14 spec allows for identifying a test as a "subtest"

 TAP version 14
 1..2

 # Subtest: foo.tap
     1..2
     ok 1
     ok 2 - this passed
 ok 1 - foo.tap

 # Subtest: bar.tap
     ok 1 - object should be a Bar
     not ok 2 - object.isBar should return true
       ---
       found: false
       wanted: true
       at:
         file: test/bar.ts
         line: 43
         column: 8
       ...
     ok 3 - object can bar bears # TODO
     1..3
 not ok 2 - bar.tap
   ---
   fail: 1
   todo: 1
   ...

Is migrating to TAP 14 on the roadmap?

This would allow beautifiers to correctly indent subtests as TAP 13 has no mechanism for indicating the "level" of a test (everything is just flat comments).

@ljharb
Copy link
Collaborator

ljharb commented Dec 23, 2022

Yes, that sounds great. I have no idea how to go about doing that tho :-)

what would be ideal is an env var that sets the TAP version (explicit but unsupported versions should error), that defaults to 13 - then in a future semver-major we could change the default to 14.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants