vest 5.2.0 → 5.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/SuiteSerializer.development.js +45 -2
- package/dist/cjs/SuiteSerializer.development.js.map +1 -1
- package/dist/cjs/SuiteSerializer.production.js +1 -1
- package/dist/cjs/SuiteSerializer.production.js.map +1 -1
- package/dist/cjs/vest.development.js +31 -17
- package/dist/cjs/vest.development.js.map +1 -1
- package/dist/cjs/vest.production.js +1 -1
- package/dist/cjs/vest.production.js.map +1 -1
- package/dist/es/SuiteSerializer.development.js +45 -2
- package/dist/es/SuiteSerializer.development.js.map +1 -1
- package/dist/es/SuiteSerializer.production.js +1 -1
- package/dist/es/SuiteSerializer.production.js.map +1 -1
- package/dist/es/vest.development.js +32 -18
- package/dist/es/vest.development.js.map +1 -1
- package/dist/es/vest.production.js +1 -1
- package/dist/es/vest.production.js.map +1 -1
- package/dist/umd/SuiteSerializer.development.js +48 -6
- package/dist/umd/SuiteSerializer.development.js.map +1 -1
- package/dist/umd/SuiteSerializer.production.js +1 -1
- package/dist/umd/SuiteSerializer.production.js.map +1 -1
- package/dist/umd/vest.development.js +31 -17
- package/dist/umd/vest.development.js.map +1 -1
- package/dist/umd/vest.production.js +1 -1
- package/dist/umd/vest.production.js.map +1 -1
- package/package.json +6 -6
- package/types/SuiteSerializer.d.ts +1 -0
- package/types/SuiteSerializer.d.ts.map +1 -1
- package/types/classnames.d.ts +1 -0
- package/types/classnames.d.ts.map +1 -1
- package/types/parser.d.ts +1 -0
- package/types/parser.d.ts.map +1 -1
- package/types/promisify.d.ts +1 -0
- package/types/promisify.d.ts.map +1 -1
- package/types/vest.d.ts +4 -2
- package/types/vest.d.ts.map +1 -1
|
@@ -1,22 +1,64 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vestjs-runtime')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'vestjs-runtime'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.SuiteSerializer = {}, global["vestjs-runtime"]));
|
|
5
|
-
})(this, (function (exports, vestjsRuntime) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vest-utils'), require('vestjs-runtime')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'vest-utils', 'vestjs-runtime'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.SuiteSerializer = {}, global["vest-utils"], global["vestjs-runtime"]));
|
|
5
|
+
})(this, (function (exports, vestUtils, vestjsRuntime) { 'use strict';
|
|
6
6
|
|
|
7
7
|
class SuiteSerializer {
|
|
8
8
|
static serialize(suite) {
|
|
9
9
|
const dump = Object.assign(Object.assign({}, suite.dump()), { output: undefined });
|
|
10
|
-
return vestjsRuntime.IsolateSerializer.serialize(dump);
|
|
10
|
+
return vestjsRuntime.IsolateSerializer.serialize(dump, MiniMap);
|
|
11
11
|
}
|
|
12
12
|
static deserialize(serialized) {
|
|
13
|
-
return vestjsRuntime.IsolateSerializer.deserialize(serialized);
|
|
13
|
+
return vestjsRuntime.IsolateSerializer.deserialize(serialized, MiniMap);
|
|
14
14
|
}
|
|
15
15
|
static resume(suite, root) {
|
|
16
16
|
const suiteRoot = SuiteSerializer.deserialize(root);
|
|
17
17
|
suite.resume(suiteRoot);
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
+
const testMiniMap = {
|
|
21
|
+
asyncTest: '_at',
|
|
22
|
+
fieldName: 'fN',
|
|
23
|
+
groupName: 'gN',
|
|
24
|
+
message: 'ms',
|
|
25
|
+
severity: 'sv',
|
|
26
|
+
status: 'st',
|
|
27
|
+
testFn: '_tf', // testFn is not serialized
|
|
28
|
+
};
|
|
29
|
+
const focusMiniMap = {
|
|
30
|
+
focusMode: 'fM',
|
|
31
|
+
match: 'm',
|
|
32
|
+
matchAll: 'mA',
|
|
33
|
+
};
|
|
34
|
+
const MiniMap = {
|
|
35
|
+
keys: {
|
|
36
|
+
data: vestUtils.assign({}, testMiniMap, focusMiniMap),
|
|
37
|
+
},
|
|
38
|
+
values: {
|
|
39
|
+
status: {
|
|
40
|
+
CANCELED: 'C',
|
|
41
|
+
DONE: 'D',
|
|
42
|
+
FAILED: 'F',
|
|
43
|
+
INITIAL: 'I',
|
|
44
|
+
OMITTED: 'O',
|
|
45
|
+
PASSING: 'P',
|
|
46
|
+
PENDING: 'PE',
|
|
47
|
+
SKIPPED: 'S',
|
|
48
|
+
UNTESTED: 'U',
|
|
49
|
+
WARNING: 'W',
|
|
50
|
+
},
|
|
51
|
+
$type: {
|
|
52
|
+
Each: 'E',
|
|
53
|
+
Focused: 'F',
|
|
54
|
+
Group: 'G',
|
|
55
|
+
OmitWhen: 'OW',
|
|
56
|
+
SkipWhen: 'SW',
|
|
57
|
+
Suite: 'S',
|
|
58
|
+
Test: 'T',
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
};
|
|
20
62
|
|
|
21
63
|
exports.SuiteSerializer = SuiteSerializer;
|
|
22
64
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SuiteSerializer.development.js","sources":["../../src/exports/SuiteSerializer.ts"],"sourcesContent":["import { IsolateSerializer } from 'vestjs-runtime';\n\nimport { TIsolateSuite } from 'IsolateSuite';\nimport { TFieldName, TGroupName } from 'SuiteResultTypes';\nimport { Suite } from 'SuiteTypes';\n\nexport class SuiteSerializer {\n static serialize(suite: Suite<TFieldName, TGroupName>) {\n const dump = { ...suite.dump(), output: undefined };\n\n return IsolateSerializer.serialize(dump);\n }\n\n static deserialize(\n serialized: string | TIsolateSuite | Record<string, any>\n ): TIsolateSuite {\n return IsolateSerializer.deserialize(serialized) as TIsolateSuite;\n }\n\n static resume(\n suite: Suite<TFieldName, TGroupName>,\n root: string | TIsolateSuite | Record<string, any>\n ): void {\n const suiteRoot = SuiteSerializer.deserialize(root);\n\n suite.resume(suiteRoot);\n }\n}\n"],"names":["IsolateSerializer"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"SuiteSerializer.development.js","sources":["../../src/exports/SuiteSerializer.ts"],"sourcesContent":["import { assign } from 'vest-utils';\nimport { IsolateSerializer } from 'vestjs-runtime';\n\nimport { CommonStates } from 'CommonStateMachine';\nimport { TIsolateSuite } from 'IsolateSuite';\nimport { IsolateTestPayload } from 'IsolateTest';\nimport { TestStatus } from 'IsolateTestStateMachine';\nimport { TFieldName, TGroupName } from 'SuiteResultTypes';\nimport { Suite } from 'SuiteTypes';\nimport { VestIsolateType } from 'VestIsolateType';\nimport { IsolateFocusedPayload } from 'focused';\n\nexport class SuiteSerializer {\n static serialize(suite: Suite<TFieldName, TGroupName>) {\n const dump = { ...suite.dump(), output: undefined };\n\n return IsolateSerializer.serialize(dump, MiniMap);\n }\n\n static deserialize(\n serialized: string | TIsolateSuite | Record<string, any>\n ): TIsolateSuite {\n return IsolateSerializer.deserialize(serialized, MiniMap) as TIsolateSuite;\n }\n\n static resume(\n suite: Suite<TFieldName, TGroupName>,\n root: string | TIsolateSuite | Record<string, any>\n ): void {\n const suiteRoot = SuiteSerializer.deserialize(root);\n\n suite.resume(suiteRoot);\n }\n}\n\nconst testMiniMap: Record<keyof IsolateTestPayload, string> = {\n asyncTest: '_at', // asyncTest is not serialized\n fieldName: 'fN',\n groupName: 'gN',\n message: 'ms',\n severity: 'sv',\n status: 'st',\n testFn: '_tf', // testFn is not serialized\n};\n\nconst focusMiniMap: Record<keyof IsolateFocusedPayload, string> = {\n focusMode: 'fM',\n match: 'm',\n matchAll: 'mA',\n};\n\nconst MiniMap: MiniMap = {\n keys: {\n data: assign({}, testMiniMap, focusMiniMap),\n },\n values: {\n status: {\n CANCELED: 'C',\n DONE: 'D',\n FAILED: 'F',\n INITIAL: 'I',\n OMITTED: 'O',\n PASSING: 'P',\n PENDING: 'PE',\n SKIPPED: 'S',\n UNTESTED: 'U',\n WARNING: 'W',\n },\n $type: {\n Each: 'E',\n Focused: 'F',\n Group: 'G',\n OmitWhen: 'OW',\n SkipWhen: 'SW',\n Suite: 'S',\n Test: 'T',\n },\n },\n};\n\ntype MiniMap = {\n keys: {\n data: Record<keyof IsolateTestPayload, string> &\n Record<keyof IsolateFocusedPayload, string>;\n };\n values: {\n status: Record<keyof typeof TestStatus, string> &\n Record<keyof typeof CommonStates, string>;\n $type: Record<keyof typeof VestIsolateType, string>;\n };\n};\n"],"names":["IsolateSerializer","assign"],"mappings":";;;;;;QAYa,eAAe,CAAA;MAC1B,OAAO,SAAS,CAAC,KAAoC,EAAA;UACnD,MAAM,IAAI,GAAQ,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAA,KAAK,CAAC,IAAI,EAAE,CAAA,EAAA,EAAE,MAAM,EAAE,SAAS,EAAA,CAAE,CAAC;UAEpD,OAAOA,+BAAiB,CAAC,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;OACnD;MAED,OAAO,WAAW,CAChB,UAAwD,EAAA;UAExD,OAAOA,+BAAiB,CAAC,WAAW,CAAC,UAAU,EAAE,OAAO,CAAkB,CAAC;OAC5E;EAED,IAAA,OAAO,MAAM,CACX,KAAoC,EACpC,IAAkD,EAAA;UAElD,MAAM,SAAS,GAAG,eAAe,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;EAEpD,QAAA,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;OACzB;EACF,CAAA;EAED,MAAM,WAAW,GAA6C;EAC5D,IAAA,SAAS,EAAE,KAAK;EAChB,IAAA,SAAS,EAAE,IAAI;EACf,IAAA,SAAS,EAAE,IAAI;EACf,IAAA,OAAO,EAAE,IAAI;EACb,IAAA,QAAQ,EAAE,IAAI;EACd,IAAA,MAAM,EAAE,IAAI;MACZ,MAAM,EAAE,KAAK;GACd,CAAC;EAEF,MAAM,YAAY,GAAgD;EAChE,IAAA,SAAS,EAAE,IAAI;EACf,IAAA,KAAK,EAAE,GAAG;EACV,IAAA,QAAQ,EAAE,IAAI;GACf,CAAC;EAEF,MAAM,OAAO,GAAY;EACvB,IAAA,IAAI,EAAE;UACJ,IAAI,EAAEC,gBAAM,CAAC,EAAE,EAAE,WAAW,EAAE,YAAY,CAAC;EAC5C,KAAA;EACD,IAAA,MAAM,EAAE;EACN,QAAA,MAAM,EAAE;EACN,YAAA,QAAQ,EAAE,GAAG;EACb,YAAA,IAAI,EAAE,GAAG;EACT,YAAA,MAAM,EAAE,GAAG;EACX,YAAA,OAAO,EAAE,GAAG;EACZ,YAAA,OAAO,EAAE,GAAG;EACZ,YAAA,OAAO,EAAE,GAAG;EACZ,YAAA,OAAO,EAAE,IAAI;EACb,YAAA,OAAO,EAAE,GAAG;EACZ,YAAA,QAAQ,EAAE,GAAG;EACb,YAAA,OAAO,EAAE,GAAG;EACb,SAAA;EACD,QAAA,KAAK,EAAE;EACL,YAAA,IAAI,EAAE,GAAG;EACT,YAAA,OAAO,EAAE,GAAG;EACZ,YAAA,KAAK,EAAE,GAAG;EACV,YAAA,QAAQ,EAAE,IAAI;EACd,YAAA,QAAQ,EAAE,IAAI;EACd,YAAA,KAAK,EAAE,GAAG;EACV,YAAA,IAAI,EAAE,GAAG;EACV,SAAA;EACF,KAAA;GACF;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vest-utils"),require("vestjs-runtime")):"function"==typeof define&&define.amd?define(["exports","vest-utils","vestjs-runtime"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).SuiteSerializer={},e["vest-utils"],e["vestjs-runtime"])}(this,(function(e,t,s){"use strict";class i{static serialize(e){const t=Object.assign(Object.assign({},e.dump()),{output:void 0});return s.IsolateSerializer.serialize(t,a)}static deserialize(e){return s.IsolateSerializer.deserialize(e,a)}static resume(e,t){const s=i.deserialize(t);e.resume(s)}}const a={keys:{data:t.assign({},{asyncTest:"_at",fieldName:"fN",groupName:"gN",message:"ms",severity:"sv",status:"st",testFn:"_tf"},{focusMode:"fM",match:"m",matchAll:"mA"})},values:{status:{CANCELED:"C",DONE:"D",FAILED:"F",INITIAL:"I",OMITTED:"O",PASSING:"P",PENDING:"PE",SKIPPED:"S",UNTESTED:"U",WARNING:"W"},$type:{Each:"E",Focused:"F",Group:"G",OmitWhen:"OW",SkipWhen:"SW",Suite:"S",Test:"T"}}};e.SuiteSerializer=i}));
|
|
2
2
|
//# sourceMappingURL=SuiteSerializer.production.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SuiteSerializer.production.js","sources":["../../src/exports/SuiteSerializer.ts"],"sourcesContent":["import { IsolateSerializer } from 'vestjs-runtime';\n\nimport { TIsolateSuite } from 'IsolateSuite';\nimport { TFieldName, TGroupName } from 'SuiteResultTypes';\nimport { Suite } from 'SuiteTypes';\n\nexport class SuiteSerializer {\n static serialize(suite: Suite<TFieldName, TGroupName>) {\n const dump = { ...suite.dump(), output: undefined };\n\n return IsolateSerializer.serialize(dump);\n }\n\n static deserialize(\n serialized: string | TIsolateSuite | Record<string, any>\n ): TIsolateSuite {\n return IsolateSerializer.deserialize(serialized) as TIsolateSuite;\n }\n\n static resume(\n suite: Suite<TFieldName, TGroupName>,\n root: string | TIsolateSuite | Record<string, any>\n ): void {\n const suiteRoot = SuiteSerializer.deserialize(root);\n\n suite.resume(suiteRoot);\n }\n}\n"],"names":["SuiteSerializer","static","suite","dump","Object","assign","output","undefined","IsolateSerializer","serialize","serialized","deserialize","root","suiteRoot","resume"],"mappings":"
|
|
1
|
+
{"version":3,"file":"SuiteSerializer.production.js","sources":["../../src/exports/SuiteSerializer.ts"],"sourcesContent":["import { assign } from 'vest-utils';\nimport { IsolateSerializer } from 'vestjs-runtime';\n\nimport { CommonStates } from 'CommonStateMachine';\nimport { TIsolateSuite } from 'IsolateSuite';\nimport { IsolateTestPayload } from 'IsolateTest';\nimport { TestStatus } from 'IsolateTestStateMachine';\nimport { TFieldName, TGroupName } from 'SuiteResultTypes';\nimport { Suite } from 'SuiteTypes';\nimport { VestIsolateType } from 'VestIsolateType';\nimport { IsolateFocusedPayload } from 'focused';\n\nexport class SuiteSerializer {\n static serialize(suite: Suite<TFieldName, TGroupName>) {\n const dump = { ...suite.dump(), output: undefined };\n\n return IsolateSerializer.serialize(dump, MiniMap);\n }\n\n static deserialize(\n serialized: string | TIsolateSuite | Record<string, any>\n ): TIsolateSuite {\n return IsolateSerializer.deserialize(serialized, MiniMap) as TIsolateSuite;\n }\n\n static resume(\n suite: Suite<TFieldName, TGroupName>,\n root: string | TIsolateSuite | Record<string, any>\n ): void {\n const suiteRoot = SuiteSerializer.deserialize(root);\n\n suite.resume(suiteRoot);\n }\n}\n\nconst testMiniMap: Record<keyof IsolateTestPayload, string> = {\n asyncTest: '_at', // asyncTest is not serialized\n fieldName: 'fN',\n groupName: 'gN',\n message: 'ms',\n severity: 'sv',\n status: 'st',\n testFn: '_tf', // testFn is not serialized\n};\n\nconst focusMiniMap: Record<keyof IsolateFocusedPayload, string> = {\n focusMode: 'fM',\n match: 'm',\n matchAll: 'mA',\n};\n\nconst MiniMap: MiniMap = {\n keys: {\n data: assign({}, testMiniMap, focusMiniMap),\n },\n values: {\n status: {\n CANCELED: 'C',\n DONE: 'D',\n FAILED: 'F',\n INITIAL: 'I',\n OMITTED: 'O',\n PASSING: 'P',\n PENDING: 'PE',\n SKIPPED: 'S',\n UNTESTED: 'U',\n WARNING: 'W',\n },\n $type: {\n Each: 'E',\n Focused: 'F',\n Group: 'G',\n OmitWhen: 'OW',\n SkipWhen: 'SW',\n Suite: 'S',\n Test: 'T',\n },\n },\n};\n\ntype MiniMap = {\n keys: {\n data: Record<keyof IsolateTestPayload, string> &\n Record<keyof IsolateFocusedPayload, string>;\n };\n values: {\n status: Record<keyof typeof TestStatus, string> &\n Record<keyof typeof CommonStates, string>;\n $type: Record<keyof typeof VestIsolateType, string>;\n };\n};\n"],"names":["SuiteSerializer","static","suite","dump","Object","assign","output","undefined","IsolateSerializer","serialize","MiniMap","serialized","deserialize","root","suiteRoot","resume","keys","data","asyncTest","fieldName","groupName","message","severity","status","testFn","focusMode","match","matchAll","values","CANCELED","DONE","FAILED","INITIAL","OMITTED","PASSING","PENDING","SKIPPED","UNTESTED","WARNING","$type","Each","Focused","Group","OmitWhen","SkipWhen","Suite","Test"],"mappings":"mXAYaA,EACXC,iBAAiBC,GACf,MAAMC,EAAYC,OAAAC,OAAAD,OAAAC,OAAA,CAAA,EAAAH,EAAMC,QAAM,CAAEG,YAAQC,IAExC,OAAOC,oBAAkBC,UAAUN,EAAMO,EAC1C,CAEDT,mBACEU,GAEA,OAAOH,oBAAkBI,YAAYD,EAAYD,EAClD,CAEDT,cACEC,EACAW,GAEA,MAAMC,EAAYd,EAAgBY,YAAYC,GAE9CX,EAAMa,OAAOD,EACd,EAGH,MAgBMJ,EAAmB,CACvBM,KAAM,CACJC,KAAMZ,EAAMA,OAAC,GAlB6C,CAC5Da,UAAW,MACXC,UAAW,KACXC,UAAW,KACXC,QAAS,KACTC,SAAU,KACVC,OAAQ,KACRC,OAAQ,OAGwD,CAChEC,UAAW,KACXC,MAAO,IACPC,SAAU,QAOVC,OAAQ,CACNL,OAAQ,CACNM,SAAU,IACVC,KAAM,IACNC,OAAQ,IACRC,QAAS,IACTC,QAAS,IACTC,QAAS,IACTC,QAAS,KACTC,QAAS,IACTC,SAAU,IACVC,QAAS,KAEXC,MAAO,CACLC,KAAM,IACNC,QAAS,IACTC,MAAO,IACPC,SAAU,KACVC,SAAU,KACVC,MAAO,IACPC,KAAM"}
|
|
@@ -232,6 +232,25 @@
|
|
|
232
232
|
}
|
|
233
233
|
const CommonStateMachine = vestUtils.StateMachine(machine$1);
|
|
234
234
|
|
|
235
|
+
class VestIsolate {
|
|
236
|
+
static getStatus(isolate) {
|
|
237
|
+
return vestUtils.nonnullish(isolate.status);
|
|
238
|
+
}
|
|
239
|
+
static setStatus(isolate, status, payload) {
|
|
240
|
+
isolate.status = this.stateMachine.staticTransition(VestIsolate.getStatus(isolate), status, payload);
|
|
241
|
+
}
|
|
242
|
+
static statusEquals(isolate, status) {
|
|
243
|
+
return VestIsolate.getStatus(isolate) === status;
|
|
244
|
+
}
|
|
245
|
+
static setPending(isolate) {
|
|
246
|
+
this.setStatus(isolate, CommonStates.PENDING);
|
|
247
|
+
}
|
|
248
|
+
static isPending(isolate) {
|
|
249
|
+
return VestIsolate.statusEquals(isolate, CommonStates.PENDING);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
VestIsolate.stateMachine = CommonStateMachine;
|
|
253
|
+
|
|
235
254
|
var ErrorStrings;
|
|
236
255
|
(function (ErrorStrings) {
|
|
237
256
|
ErrorStrings["HOOK_CALLED_OUTSIDE"] = "hook called outside of a running suite.";
|
|
@@ -318,7 +337,7 @@
|
|
|
318
337
|
TestSeverity["Warning"] = "warning";
|
|
319
338
|
})(TestSeverity || (TestSeverity = {}));
|
|
320
339
|
|
|
321
|
-
class VestTest {
|
|
340
|
+
class VestTest extends VestIsolate {
|
|
322
341
|
// Read
|
|
323
342
|
static getData(test) {
|
|
324
343
|
vestUtils.invariant(test.data);
|
|
@@ -337,9 +356,6 @@
|
|
|
337
356
|
static warns(test) {
|
|
338
357
|
return VestTest.getData(test).severity === TestSeverity.Warning;
|
|
339
358
|
}
|
|
340
|
-
static isPending(test) {
|
|
341
|
-
return VestTest.statusEquals(test, TestStatus.PENDING);
|
|
342
|
-
}
|
|
343
359
|
static isOmitted(test) {
|
|
344
360
|
return VestTest.statusEquals(test, TestStatus.OMITTED);
|
|
345
361
|
}
|
|
@@ -382,13 +398,10 @@
|
|
|
382
398
|
static isAsyncTest(test) {
|
|
383
399
|
return vestUtils.isPromise(VestTest.getData(test).asyncTest);
|
|
384
400
|
}
|
|
385
|
-
static statusEquals(test, status) {
|
|
386
|
-
return test.status === status;
|
|
387
|
-
}
|
|
388
401
|
// Mutate
|
|
389
|
-
static setPending(test) {
|
|
390
|
-
|
|
391
|
-
}
|
|
402
|
+
// static setPending(test: TIsolateTest) {
|
|
403
|
+
// this.setStatus(test, TestStatus.PENDING);
|
|
404
|
+
// }
|
|
392
405
|
static fail(test) {
|
|
393
406
|
VestTest.setStatus(test, VestTest.warns(test) ? TestStatus.WARNING : TestStatus.FAILED);
|
|
394
407
|
}
|
|
@@ -424,10 +437,8 @@
|
|
|
424
437
|
static reset(test) {
|
|
425
438
|
VestTest.setStatus(test, TestAction.RESET);
|
|
426
439
|
}
|
|
427
|
-
static setStatus(test, status, payload) {
|
|
428
|
-
test.status = IsolateTestStateMachine.staticTransition(test.status, status, payload);
|
|
429
|
-
}
|
|
430
440
|
}
|
|
441
|
+
VestTest.stateMachine = IsolateTestStateMachine;
|
|
431
442
|
|
|
432
443
|
function nonMatchingFieldName(WithFieldName, fieldName) {
|
|
433
444
|
return !!fieldName && !matchingFieldName(WithFieldName, fieldName);
|
|
@@ -448,7 +459,7 @@
|
|
|
448
459
|
if (!root) {
|
|
449
460
|
return false;
|
|
450
461
|
}
|
|
451
|
-
return vestjsRuntime.Walker.some(root, vestUtils.Predicates.all(
|
|
462
|
+
return vestjsRuntime.Walker.some(root, vestUtils.Predicates.all(VestIsolate.isPending, predicate !== null && predicate !== void 0 ? predicate : true));
|
|
452
463
|
}
|
|
453
464
|
// Checks whether there are pending isolates in the tree.
|
|
454
465
|
// If a fieldname is provided, will only check tests with a matching fieldname.
|
|
@@ -459,9 +470,6 @@
|
|
|
459
470
|
}
|
|
460
471
|
}
|
|
461
472
|
SuiteWalker.defaultRoot = vestjsRuntime.VestRuntime.useAvailableRoot;
|
|
462
|
-
function isPendingStatus(isolate) {
|
|
463
|
-
return isolate.status === CommonStates.PENDING;
|
|
464
|
-
}
|
|
465
473
|
|
|
466
474
|
class TestWalker {
|
|
467
475
|
static hasNoTests(root = TestWalker.defaultRoot()) {
|
|
@@ -819,6 +827,7 @@
|
|
|
819
827
|
isPending: (...args) => {
|
|
820
828
|
return get().isPending(...args);
|
|
821
829
|
},
|
|
830
|
+
isTested: (...args) => get().isTested(...args),
|
|
822
831
|
isValid: (...args) => get().isValid(...args),
|
|
823
832
|
isValidByGroup: (...args) => get().isValidByGroup(...args),
|
|
824
833
|
};
|
|
@@ -837,6 +846,7 @@
|
|
|
837
846
|
hasWarnings,
|
|
838
847
|
hasWarningsByGroup,
|
|
839
848
|
isPending,
|
|
849
|
+
isTested,
|
|
840
850
|
isValid,
|
|
841
851
|
isValidByGroup,
|
|
842
852
|
};
|
|
@@ -867,6 +877,10 @@
|
|
|
867
877
|
function hasErrors(fieldName) {
|
|
868
878
|
return hasFailures(summary, SeverityCount.ERROR_COUNT, fieldName);
|
|
869
879
|
}
|
|
880
|
+
function isTested(fieldName) {
|
|
881
|
+
var _a;
|
|
882
|
+
return vestUtils.isPositive((_a = summary.tests[fieldName]) === null || _a === void 0 ? void 0 : _a.testCount);
|
|
883
|
+
}
|
|
870
884
|
function hasWarningsByGroup(groupName, fieldName) {
|
|
871
885
|
return hasFailuresByGroup(summary, SeverityCount.WARN_COUNT, groupName, fieldName);
|
|
872
886
|
}
|