Skip to content

Commit

Permalink
core: inherit diagnostic option in subtests
Browse files Browse the repository at this point in the history
fixes #984

PR-URL: #985
Credit: @utybo
Close: #985
Reviewed-by: @isaacs
  • Loading branch information
utybo authored and isaacs committed Jan 19, 2024
1 parent eb060c7 commit 5e28526
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 44 deletions.
2 changes: 1 addition & 1 deletion src/core/dist/commonjs/test-base.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/core/dist/commonjs/test-base.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/core/dist/commonjs/test-base.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/core/dist/esm/test-base.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/core/dist/esm/test-base.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/core/dist/esm/test-base.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/core/src/test-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,7 @@ export class TestBase extends Base<TestBaseEvents> {
'passes',
'failTodo',
'failSkip',
'diagnostic',
] as const
for (const k of inheritedFlags) {
if (
Expand Down
20 changes: 0 additions & 20 deletions src/core/tap-snapshots/test/test-base.ts.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -51,26 +51,6 @@ TAP version 14
ok 1 - child # time={TIME}
not ok 2 - cannot create subtest after parent promise resolves
---
stack: |
Minimal.<anonymous> (test/test-base.ts:1664:13)
at:
fileName: test/test-base.ts
lineNumber: ##
columnNumber: ##
typeName: Minimal
methodName: <anonymous>
functionName: Minimal.<anonymous>
test: child
source: |2
if (!subtest) throw new Error('did not get subtest')
await p
subtest.test('this should not work', async () => {})
------------^
})
tb.end()
...
1..2
not ok 1 - parent # time={TIME}
Expand Down

0 comments on commit 5e28526

Please sign in to comment.