We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
await plan
1 parent e8e854d commit 03b31d9Copy full SHA for 03b31d9
test.js
@@ -83,3 +83,13 @@ test('wait', async (t) => {
83
84
await completed
85
})
86
+
87
+test('await plan', async (t) => {
88
+ const plan = tspl(t, { plan: 1 })
89
90
+ setImmediate(() => {
91
+ plan.strictEqual(1, 1)
92
+ })
93
94
+ await plan
95
+})
tspl.js
@@ -45,6 +45,12 @@ function tspl (t, opts = {}) {
45
end
46
}
47
48
+ Object.defineProperty(res, 'then', {
49
+ get () {
50
+ return completed.then.bind(completed)
51
+ }
52
53
54
for (const method of Object.keys(assert)) {
55
if (method.match(/^[a-z]/)) {
56
res[method] = (...args) => {
0 commit comments