-
-
Save isaacs/0f6d49fd7264625c9db0e2414ff90072 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Test } from '@tapjs/test' | |
import assert from 'node:assert' | |
const t = new Test({}) | |
t.stream.pipe(process.stdout) | |
t.before(() => { | |
assert.equal(t.t, t, 'self ref is equal in before()') | |
}) | |
t.after(() => { | |
assert.equal(t.t, t, 'self-ref is equal in after()') | |
}) | |
t.equal(t.t, t, 'returned test equals self-reference t property') | |
t.test('child test', function someName(tt) { | |
tt.equal(1, 2) | |
return tt.end() | |
}) | |
t.end() | |
/* | |
TAP version 14 | |
ok 1 - returned test equals self-reference t property | |
# Subtest: child test | |
not ok 1 - should be equal | |
--- | |
diff: | | |
--- expected | |
+++ actual | |
@@ -1,1 +1,1 @@ | |
-2 | |
+1 | |
compare: === | |
at: | |
line: 18 | |
column: 6 | |
file: t.ts | |
function: Test.someName | |
stack: | | |
Test.someName (t.ts:18:6) | |
Object.<anonymous> (t.ts:17:3) | |
source: | | |
t.test('child test', function someName(tt) { | |
tt.equal(1, 2) | |
-----^ | |
return tt.end() | |
}) | |
... | |
1..1 | |
# failed 1 test | |
not ok 2 - child test # time=12862ms | |
--- | |
stack: | | |
Object.<anonymous> (t.ts:17:3) | |
context: null | |
... | |
1..2 | |
# failed 1 of 2 tests | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment