MCPcopy Create free account
hub / github.com/nodejs/node / done

Function done

test/fixtures/wpt/resources/testharness.js:1189–1208  ·  view source on GitHub ↗

* Mark test loading as complete. * * Typically this function is called implicitly on page load; it's * only necessary for users to call this when either the * ``explicit_done`` or ``single_test`` properties have been set * via the :js:func:`setup` function. * * For

()

Source from the content-addressed store, hash-verified

1187 * For other tests, this marks test loading as complete, but doesn't affect ongoing tests.
1188 */
1189 function done() {
1190 if (tests.tests.length === 0) {
1191 // `done` is invoked after handling uncaught exceptions, so if the
1192 // harness status is already set, the corresponding message is more
1193 // descriptive than the generic message defined here.
1194 if (tests.status.status === null) {
1195 tests.status.status = tests.status.ERROR;
1196 tests.status.message = "done() was called without first defining any tests";
1197 }
1198
1199 tests.complete();
1200 return;
1201 }
1202 if (tests.file_is_test) {
1203 // file is test files never have asynchronous cleanup logic,
1204 // meaning the fully-synchronous `done` function can be used here.
1205 tests.tests[0].done();
1206 }
1207 tests.end_wait();
1208 }
1209
1210 /**
1211 * @deprecated generate a list of tests from a function and list of arguments

Calls 2

completeMethod · 0.45
doneMethod · 0.45

Tested by

no test coverage detected