You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Again, running tap foo.js fails, but this time with a different error:
foo.js ..1..1
foo.js ................................................ 1/3
parent promise
not ok test count !== plan
+++ found
--- wanted
-1
+0
results:
ok: false
count: 0
pass: 0
fail: 1
bailout: false
todo: 0
skip: 0
plan:
start: 1
end: 1
skipAll: false
skipReason: ''
comment: ''
failures:
- tapError: incorrect number of tests
not ok parent promise
failures:
- tapError: incorrect number of tests
total ................................................. 1/3
1 passing (331.531ms)
2 failing
This example is a bit silly, but it reproduces the scenario that is causing this error for me:
Determine a free port via the get-port module
child_process.fork a script that needs the determined port
Run tests after the forked process issues process.send('ready'), i.e. proc.on('message', (m) => { t.is(1, 1) })
Is there a way that I should be doing this instead? I really don't want to fall back to callbacks because I'm going to have a lot of asynchronous operations to test in this test.
The text was updated successfully, but these errors were encountered:
An async function is a function that returns a promise. That promise resolves when all of the async function's awaited promises are resolved.
In this case, you aren't awaiting any promises in the outer async function, so the promise it returns resolves immediately. It's (roughly) equivalent to this:
Consider:
foo.js:
Running
tap foo.js
will yield:Hmm, let's specify a definite plan:
foo.js:
Again, running
tap foo.js
fails, but this time with a different error:This example is a bit silly, but it reproduces the scenario that is causing this error for me:
get-port
modulechild_process.fork
a script that needs the determined portprocess.send('ready')
, i.e.proc.on('message', (m) => { t.is(1, 1) })
Is there a way that I should be doing this instead? I really don't want to fall back to callbacks because I'm going to have a lot of asynchronous operations to test in this test.
The text was updated successfully, but these errors were encountered: