Changeset 0.28.5 (#191)
This commit is contained in:
@@ -201,8 +201,13 @@
|
||||
try {
|
||||
await fn();
|
||||
} catch (e) {
|
||||
entry.status = 'fail';
|
||||
entry.detail = String(e && e.message ? e.message : e);
|
||||
if (e && e._skip) {
|
||||
entry.status = 'skip';
|
||||
entry.detail = String(e.message || 'skipped');
|
||||
} else {
|
||||
entry.status = 'fail';
|
||||
entry.detail = String(e && e.message ? e.message : e);
|
||||
}
|
||||
}
|
||||
entry.duration = Math.round(performance.now() - t0);
|
||||
T.results.push(entry);
|
||||
@@ -210,6 +215,17 @@
|
||||
return entry;
|
||||
};
|
||||
|
||||
/**
|
||||
* Skip a test with a reason. Call inside a T.test() fn body.
|
||||
* Skipped tests appear in results as status='skip' — not pass, not fail.
|
||||
* @param {string} reason — why this test was skipped
|
||||
*/
|
||||
T.skip = function (reason) {
|
||||
var e = new Error(reason || 'skipped');
|
||||
e._skip = true;
|
||||
throw e;
|
||||
};
|
||||
|
||||
// ─── API Wrappers ───────────────────────────────────────────
|
||||
// API._get/_post/_put already prepend __BASE__. No base prefix here.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user