vest 4.2.0 → 4.2.1-dev-ee64be

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.
@@ -5,8 +5,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var n4s = require('n4s');
6
6
  var context$1 = require('context');
7
7
 
8
- var assign = Object.assign;
9
-
10
8
  /**
11
9
  * @returns a unique numeric id.
12
10
  */
@@ -14,206 +12,76 @@ var genId = (function (n) { return function () {
14
12
  return "".concat(n++);
15
13
  }; })(0);
16
14
 
17
- function isFunction(value) {
18
- return typeof value === 'function';
19
- }
20
-
21
- function optionalFunctionValue(value) {
22
- var args = [];
23
- for (var _i = 1; _i < arguments.length; _i++) {
24
- args[_i - 1] = arguments[_i];
25
- }
26
- return isFunction(value) ? value.apply(void 0, args) : value;
27
- }
28
-
29
- function defaultTo(callback, defaultValue) {
30
- var _a;
31
- return (_a = optionalFunctionValue(callback)) !== null && _a !== void 0 ? _a : defaultValue;
32
- }
33
-
34
- /**
35
- * Throws a timed out error.
36
- */
37
- function throwError(devMessage, productionMessage) {
38
- throw new Error(devMessage );
39
- }
40
- function throwErrorDeferred(devMessage, productionMessage) {
41
- setTimeout(function () {
42
- throwError(devMessage);
43
- }, 0);
15
+ function isStringValue(v) {
16
+ return String(v) === v;
44
17
  }
45
18
 
46
- // eslint-disable-next-line max-lines-per-function
47
- function createState(onStateChange) {
48
- var state = {
49
- references: []
50
- };
51
- var registrations = [];
52
- return {
53
- registerStateKey: registerStateKey,
54
- reset: reset
55
- };
56
- /**
57
- * Registers a new key in the state, takes the initial value (may be a function that returns the initial value), returns a function.
58
- *
59
- * @example
60
- *
61
- * const useColor = state.registerStateKey("blue");
62
- *
63
- * let [color, setColor] = useColor(); // -> ["blue", Function]
64
- *
65
- * setColor("green");
66
- *
67
- * useColor()[0]; -> "green"
68
- */
69
- function registerStateKey(initialState, onUpdate) {
70
- var key = registrations.length;
71
- registrations.push([initialState, onUpdate]);
72
- return initKey(key, initialState);
73
- }
74
- function reset() {
75
- var prev = current();
76
- state.references = [];
77
- registrations.forEach(function (_a, index) {
78
- var initialValue = _a[0];
79
- return initKey(index, initialValue, prev[index]);
80
- });
81
- }
82
- function initKey(key, initialState, prevState) {
83
- current().push();
84
- set(key, optionalFunctionValue(initialState, prevState));
85
- return function useStateKey() {
86
- return [
87
- current()[key],
88
- function (nextState) {
89
- return set(key, optionalFunctionValue(nextState, current()[key]));
90
- },
91
- ];
92
- };
93
- }
94
- function current() {
95
- return state.references;
96
- }
97
- function set(index, value) {
98
- var prevValue = state.references[index];
99
- state.references[index] = value;
100
- var _a = registrations[index], onUpdate = _a[1];
101
- if (isFunction(onUpdate)) {
102
- onUpdate(value, prevValue);
103
- }
104
- if (isFunction(onStateChange)) {
105
- onStateChange();
19
+ function bindNot(fn) {
20
+ return function () {
21
+ var args = [];
22
+ for (var _i = 0; _i < arguments.length; _i++) {
23
+ args[_i] = arguments[_i];
106
24
  }
107
- }
25
+ return !fn.apply(void 0, args);
26
+ };
108
27
  }
109
28
 
110
- var IsolateTypes;
111
- (function (IsolateTypes) {
112
- IsolateTypes[IsolateTypes["DEFAULT"] = 0] = "DEFAULT";
113
- IsolateTypes[IsolateTypes["SUITE"] = 1] = "SUITE";
114
- IsolateTypes[IsolateTypes["EACH"] = 2] = "EACH";
115
- IsolateTypes[IsolateTypes["SKIP_WHEN"] = 3] = "SKIP_WHEN";
116
- IsolateTypes[IsolateTypes["OMIT_WHEN"] = 4] = "OMIT_WHEN";
117
- IsolateTypes[IsolateTypes["GROUP"] = 5] = "GROUP";
118
- })(IsolateTypes || (IsolateTypes = {}));
29
+ function isUndefined(value) {
30
+ return value === undefined;
31
+ }
119
32
 
120
- function createStateRef(state, _a) {
121
- var suiteId = _a.suiteId, suiteName = _a.suiteName;
122
- return {
123
- optionalFields: state.registerStateKey(function () { return ({}); }),
124
- suiteId: state.registerStateKey(suiteId),
125
- suiteName: state.registerStateKey(suiteName),
126
- testCallbacks: state.registerStateKey(function () { return ({
127
- fieldCallbacks: {},
128
- doneCallbacks: []
129
- }); }),
130
- testObjects: state.registerStateKey(function (prev) {
131
- return {
132
- prev: prev ? prev.current : [],
133
- current: []
134
- };
135
- })
136
- };
33
+ function shouldUseErrorAsMessage(message, error) {
34
+ // kind of cheating with this safe guard, but it does the job
35
+ return isUndefined(message) && isStringValue(error);
137
36
  }
138
37
 
139
38
  function asArray(possibleArg) {
140
39
  return [].concat(possibleArg);
141
40
  }
142
41
 
143
- function last(values) {
144
- var valuesArray = asArray(values);
145
- return valuesArray[valuesArray.length - 1];
42
+ function lengthEquals(value, arg1) {
43
+ return value.length === Number(arg1);
146
44
  }
147
45
 
148
- function createCursor() {
149
- var storage = {
150
- cursor: []
151
- };
152
- function addLevel() {
153
- storage.cursor.push(0);
154
- }
155
- function removeLevel() {
156
- storage.cursor.pop();
157
- }
158
- function cursorAt() {
159
- return last(storage.cursor);
160
- }
161
- function getCursor() {
162
- return asArray(storage.cursor);
163
- }
164
- function next() {
165
- storage.cursor[storage.cursor.length - 1]++;
166
- return last(storage.cursor);
167
- }
168
- function reset() {
169
- storage.cursor = [0];
170
- }
171
- reset();
172
- return {
173
- addLevel: addLevel,
174
- cursorAt: cursorAt,
175
- getCursor: getCursor,
176
- next: next,
177
- removeLevel: removeLevel,
178
- reset: reset
179
- };
46
+ function longerThan(value, arg1) {
47
+ return value.length > Number(arg1);
180
48
  }
181
49
 
182
- var Modes;
183
- (function (Modes) {
184
- Modes[Modes["ALL"] = 0] = "ALL";
185
- Modes[Modes["EAGER"] = 1] = "EAGER";
186
- })(Modes || (Modes = {}));
187
-
188
- var context = context$1.createContext(function (ctxRef, parentContext) {
189
- return parentContext
190
- ? null
191
- : assign({}, {
192
- exclusion: {
193
- tests: {},
194
- groups: {}
195
- },
196
- inclusion: {},
197
- isolate: {
198
- type: IsolateTypes.DEFAULT,
199
- keys: {
200
- current: {},
201
- prev: {}
202
- }
203
- },
204
- mode: [Modes.ALL],
205
- testCursor: createCursor()
206
- }, ctxRef);
207
- });
208
-
209
- function bindNot(fn) {
210
- return function () {
211
- var args = [];
212
- for (var _i = 0; _i < arguments.length; _i++) {
213
- args[_i] = arguments[_i];
214
- }
215
- return !fn.apply(void 0, args);
50
+ /**
51
+ * Creates a cache function
52
+ */
53
+ function createCache(maxSize) {
54
+ if (maxSize === void 0) { maxSize = 1; }
55
+ var cacheStorage = [];
56
+ var cache = function (deps, cacheAction) {
57
+ var cacheHit = cache.get(deps);
58
+ // cache hit is not null
59
+ if (cacheHit)
60
+ return cacheHit[1];
61
+ var result = cacheAction();
62
+ cacheStorage.unshift([deps.concat(), result]);
63
+ if (longerThan(cacheStorage, maxSize))
64
+ cacheStorage.length = maxSize;
65
+ return result;
66
+ };
67
+ // invalidate an item in the cache by its dependencies
68
+ cache.invalidate = function (deps) {
69
+ var index = findIndex(deps);
70
+ if (index > -1)
71
+ cacheStorage.splice(index, 1);
216
72
  };
73
+ // Retrieves an item from the cache.
74
+ cache.get = function (deps) {
75
+ return cacheStorage[findIndex(deps)] || null;
76
+ };
77
+ return cache;
78
+ function findIndex(deps) {
79
+ return cacheStorage.findIndex(function (_a) {
80
+ var cachedDeps = _a[0];
81
+ return lengthEquals(deps, cachedDeps.length) &&
82
+ deps.every(function (dep, i) { return dep === cachedDeps[i]; });
83
+ });
84
+ }
217
85
  }
218
86
 
219
87
  // The module is named "isArrayValue" since it
@@ -228,6 +96,28 @@ function isNull(value) {
228
96
  }
229
97
  var isNotNull = bindNot(isNull);
230
98
 
99
+ function isFunction(value) {
100
+ return typeof value === 'function';
101
+ }
102
+
103
+ function optionalFunctionValue(value) {
104
+ var args = [];
105
+ for (var _i = 1; _i < arguments.length; _i++) {
106
+ args[_i - 1] = arguments[_i];
107
+ }
108
+ return isFunction(value) ? value.apply(void 0, args) : value;
109
+ }
110
+
111
+ function defaultTo(callback, defaultValue) {
112
+ var _a;
113
+ return (_a = optionalFunctionValue(callback)) !== null && _a !== void 0 ? _a : defaultValue;
114
+ }
115
+
116
+ function last(values) {
117
+ var valuesArray = asArray(values);
118
+ return valuesArray[valuesArray.length - 1];
119
+ }
120
+
231
121
  // This is kind of a map/filter in one function.
232
122
  // Normally, behaves like a nested-array map,
233
123
  // but returning `null` will drop the element from the array
@@ -273,68 +163,79 @@ function getCurrent(array, path) {
273
163
  return current;
274
164
  }
275
165
 
276
- function isUndefined(value) {
277
- return value === undefined;
278
- }
279
-
280
- function isNullish(value) {
281
- return isNull(value) || isUndefined(value);
282
- }
283
-
284
- function isStringValue(v) {
285
- return String(v) === v;
286
- }
287
-
288
- function shouldUseErrorAsMessage(message, error) {
289
- // kind of cheating with this safe guard, but it does the job
290
- return isUndefined(message) && isStringValue(error);
291
- }
292
-
293
- function lengthEquals(value, arg1) {
294
- return value.length === Number(arg1);
295
- }
296
-
297
- function longerThan(value, arg1) {
298
- return value.length > Number(arg1);
299
- }
166
+ var assign = Object.assign;
300
167
 
301
- /**
302
- * Creates a cache function
303
- */
304
- function createCache(maxSize) {
305
- if (maxSize === void 0) { maxSize = 1; }
306
- var cacheStorage = [];
307
- var cache = function (deps, cacheAction) {
308
- var cacheHit = cache.get(deps);
309
- // cache hit is not null
310
- if (cacheHit)
311
- return cacheHit[1];
312
- var result = cacheAction();
313
- cacheStorage.unshift([deps.concat(), result]);
314
- if (longerThan(cacheStorage, maxSize))
315
- cacheStorage.length = maxSize;
316
- return result;
317
- };
318
- // invalidate an item in the cache by its dependencies
319
- cache.invalidate = function (deps) {
320
- var index = findIndex(deps);
321
- if (index > -1)
322
- cacheStorage.splice(index, 1);
323
- };
324
- // Retrieves an item from the cache.
325
- cache.get = function (deps) {
326
- return cacheStorage[findIndex(deps)] || null;
168
+ function createCursor() {
169
+ var storage = {
170
+ cursor: []
327
171
  };
328
- return cache;
329
- function findIndex(deps) {
330
- return cacheStorage.findIndex(function (_a) {
331
- var cachedDeps = _a[0];
332
- return lengthEquals(deps, cachedDeps.length) &&
333
- deps.every(function (dep, i) { return dep === cachedDeps[i]; });
334
- });
172
+ function addLevel() {
173
+ storage.cursor.push(0);
174
+ }
175
+ function removeLevel() {
176
+ storage.cursor.pop();
177
+ }
178
+ function cursorAt() {
179
+ return last(storage.cursor);
180
+ }
181
+ function getCursor() {
182
+ return asArray(storage.cursor);
183
+ }
184
+ function next() {
185
+ storage.cursor[storage.cursor.length - 1]++;
186
+ return last(storage.cursor);
187
+ }
188
+ function reset() {
189
+ storage.cursor = [0];
335
190
  }
191
+ reset();
192
+ return {
193
+ addLevel: addLevel,
194
+ cursorAt: cursorAt,
195
+ getCursor: getCursor,
196
+ next: next,
197
+ removeLevel: removeLevel,
198
+ reset: reset
199
+ };
336
200
  }
337
201
 
202
+ var IsolateTypes;
203
+ (function (IsolateTypes) {
204
+ IsolateTypes[IsolateTypes["DEFAULT"] = 0] = "DEFAULT";
205
+ IsolateTypes[IsolateTypes["SUITE"] = 1] = "SUITE";
206
+ IsolateTypes[IsolateTypes["EACH"] = 2] = "EACH";
207
+ IsolateTypes[IsolateTypes["SKIP_WHEN"] = 3] = "SKIP_WHEN";
208
+ IsolateTypes[IsolateTypes["OMIT_WHEN"] = 4] = "OMIT_WHEN";
209
+ IsolateTypes[IsolateTypes["GROUP"] = 5] = "GROUP";
210
+ })(IsolateTypes || (IsolateTypes = {}));
211
+
212
+ var Modes;
213
+ (function (Modes) {
214
+ Modes[Modes["ALL"] = 0] = "ALL";
215
+ Modes[Modes["EAGER"] = 1] = "EAGER";
216
+ })(Modes || (Modes = {}));
217
+
218
+ var context = context$1.createContext(function (ctxRef, parentContext) {
219
+ return parentContext
220
+ ? null
221
+ : assign({}, {
222
+ exclusion: {
223
+ tests: {},
224
+ groups: {}
225
+ },
226
+ inclusion: {},
227
+ isolate: {
228
+ type: IsolateTypes.DEFAULT,
229
+ keys: {
230
+ current: {},
231
+ prev: {}
232
+ }
233
+ },
234
+ mode: [Modes.ALL],
235
+ testCursor: createCursor()
236
+ }, ctxRef);
237
+ });
238
+
338
239
  // STATE REF
339
240
  function useStateRef() {
340
241
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
@@ -550,6 +451,105 @@ var STATUS_PENDING = 'PENDING';
550
451
  var STATUS_CANCELED = 'CANCELED';
551
452
  var STATUS_OMITTED = 'OMITTED';
552
453
 
454
+ /**
455
+ * Throws a timed out error.
456
+ */
457
+ function throwError(devMessage, productionMessage) {
458
+ throw new Error(devMessage );
459
+ }
460
+ function throwErrorDeferred(devMessage, productionMessage) {
461
+ setTimeout(function () {
462
+ throwError(devMessage);
463
+ }, 0);
464
+ }
465
+
466
+ // eslint-disable-next-line max-lines-per-function
467
+ function createState(onStateChange) {
468
+ var state = {
469
+ references: []
470
+ };
471
+ var registrations = [];
472
+ return {
473
+ registerStateKey: registerStateKey,
474
+ reset: reset
475
+ };
476
+ /**
477
+ * Registers a new key in the state, takes the initial value (may be a function that returns the initial value), returns a function.
478
+ *
479
+ * @example
480
+ *
481
+ * const useColor = state.registerStateKey("blue");
482
+ *
483
+ * let [color, setColor] = useColor(); // -> ["blue", Function]
484
+ *
485
+ * setColor("green");
486
+ *
487
+ * useColor()[0]; -> "green"
488
+ */
489
+ function registerStateKey(initialState, onUpdate) {
490
+ var key = registrations.length;
491
+ registrations.push([initialState, onUpdate]);
492
+ return initKey(key, initialState);
493
+ }
494
+ function reset() {
495
+ var prev = current();
496
+ state.references = [];
497
+ registrations.forEach(function (_a, index) {
498
+ var initialValue = _a[0];
499
+ return initKey(index, initialValue, prev[index]);
500
+ });
501
+ }
502
+ function initKey(key, initialState, prevState) {
503
+ current().push();
504
+ set(key, optionalFunctionValue(initialState, prevState));
505
+ return function useStateKey() {
506
+ return [
507
+ current()[key],
508
+ function (nextState) {
509
+ return set(key, optionalFunctionValue(nextState, current()[key]));
510
+ },
511
+ ];
512
+ };
513
+ }
514
+ function current() {
515
+ return state.references;
516
+ }
517
+ function set(index, value) {
518
+ var prevValue = state.references[index];
519
+ state.references[index] = value;
520
+ var _a = registrations[index], onUpdate = _a[1];
521
+ if (isFunction(onUpdate)) {
522
+ onUpdate(value, prevValue);
523
+ }
524
+ if (isFunction(onStateChange)) {
525
+ onStateChange();
526
+ }
527
+ }
528
+ }
529
+
530
+ function createStateRef(state, _a) {
531
+ var suiteId = _a.suiteId, suiteName = _a.suiteName;
532
+ return {
533
+ optionalFields: state.registerStateKey(function () { return ({}); }),
534
+ suiteId: state.registerStateKey(suiteId),
535
+ suiteName: state.registerStateKey(suiteName),
536
+ testCallbacks: state.registerStateKey(function () { return ({
537
+ fieldCallbacks: {},
538
+ doneCallbacks: []
539
+ }); }),
540
+ testObjects: state.registerStateKey(function (prev) {
541
+ return {
542
+ prev: prev ? prev.current : [],
543
+ current: []
544
+ };
545
+ })
546
+ };
547
+ }
548
+
549
+ function isNullish(value) {
550
+ return isNull(value) || isUndefined(value);
551
+ }
552
+
553
553
  function usePath() {
554
554
  var context$1 = context.useX();
555
555
  return context$1.testCursor.getCursor();
@@ -623,57 +623,6 @@ function shouldAllowReorder() {
623
623
  return context.useX().isolate.type === IsolateTypes.EACH;
624
624
  }
625
625
 
626
- /**
627
- * A safe hasOwnProperty access
628
- */
629
- function hasOwnProperty(obj, key) {
630
- return Object.prototype.hasOwnProperty.call(obj, key);
631
- }
632
-
633
- function isNumber(value) {
634
- return Boolean(typeof value === 'number');
635
- }
636
-
637
- function isEmpty(value) {
638
- if (!value) {
639
- return true;
640
- }
641
- else if (isNumber(value)) {
642
- return value === 0;
643
- }
644
- else if (hasOwnProperty(value, 'length')) {
645
- return lengthEquals(value, 0);
646
- }
647
- else if (typeof value === 'object') {
648
- return lengthEquals(Object.keys(value), 0);
649
- }
650
- return true;
651
- }
652
- var isNotEmpty = bindNot(isEmpty);
653
-
654
- function nonMatchingFieldName(testObject, fieldName) {
655
- return !!fieldName && !matchingFieldName(testObject, fieldName);
656
- }
657
- function matchingFieldName(testObject, fieldName) {
658
- return !!(fieldName && testObject.fieldName === fieldName);
659
- }
660
-
661
- /**
662
- * Checks if a given field, or the suite as a whole still have remaining tests.
663
- */
664
- function hasRemainingTests(fieldName) {
665
- var allIncomplete = useAllIncomplete();
666
- if (isEmpty(allIncomplete)) {
667
- return false;
668
- }
669
- if (fieldName) {
670
- return allIncomplete.some(function (testObject) {
671
- return matchingFieldName(testObject, fieldName);
672
- });
673
- }
674
- return isNotEmpty(allIncomplete);
675
- }
676
-
677
626
  var Severity;
678
627
  (function (Severity) {
679
628
  Severity["WARNINGS"] = "warnings";
@@ -781,6 +730,13 @@ function __spreadArray(to, from, pack) {
781
730
  return to.concat(ar || Array.prototype.slice.call(from));
782
731
  }
783
732
 
733
+ function nonMatchingFieldName(testObject, fieldName) {
734
+ return !!fieldName && !matchingFieldName(testObject, fieldName);
735
+ }
736
+ function matchingFieldName(testObject, fieldName) {
737
+ return !!(fieldName && testObject.fieldName === fieldName);
738
+ }
739
+
784
740
  function either(a, b) {
785
741
  return !!a !== !!b;
786
742
  }
@@ -916,6 +872,34 @@ function hasByGroup(severityKey, group, fieldName) {
916
872
  });
917
873
  }
918
874
 
875
+ /**
876
+ * A safe hasOwnProperty access
877
+ */
878
+ function hasOwnProperty(obj, key) {
879
+ return Object.prototype.hasOwnProperty.call(obj, key);
880
+ }
881
+
882
+ function isNumber(value) {
883
+ return Boolean(typeof value === 'number');
884
+ }
885
+
886
+ function isEmpty(value) {
887
+ if (!value) {
888
+ return true;
889
+ }
890
+ else if (isNumber(value)) {
891
+ return value === 0;
892
+ }
893
+ else if (hasOwnProperty(value, 'length')) {
894
+ return lengthEquals(value, 0);
895
+ }
896
+ else if (typeof value === 'object') {
897
+ return lengthEquals(Object.keys(value), 0);
898
+ }
899
+ return true;
900
+ }
901
+ var isNotEmpty = bindNot(isEmpty);
902
+
919
903
  // eslint-disable-next-line max-statements, complexity
920
904
  function isValid(result, fieldName) {
921
905
  if (fieldIsOmitted(fieldName)) {
@@ -969,7 +953,7 @@ function noMissingTests(fieldName) {
969
953
  }
970
954
 
971
955
  var cache$1 = createCache(20);
972
- function produceDraft() {
956
+ function produceBase() {
973
957
  var testObjects = useTestsFlat();
974
958
  var ctxRef = { stateRef: useStateRef() };
975
959
  return cache$1([testObjects], context.bind(ctxRef, function () {
@@ -984,19 +968,35 @@ function produceDraft() {
984
968
  hasWarnings: context.bind(ctxRef, hasWarnings),
985
969
  hasWarningsByGroup: context.bind(ctxRef, hasWarningsByGroup),
986
970
  isValid: context.bind(ctxRef, function (fieldName) {
987
- return isValid(produceDraft(), fieldName);
971
+ return isValid(produceBase(), fieldName);
988
972
  }),
989
973
  suiteName: suiteName
990
974
  });
991
975
  }));
992
976
  }
993
977
 
978
+ /**
979
+ * Checks if a given field, or the suite as a whole still have remaining tests.
980
+ */
981
+ function hasRemainingTests(fieldName) {
982
+ var allIncomplete = useAllIncomplete();
983
+ if (isEmpty(allIncomplete)) {
984
+ return false;
985
+ }
986
+ if (fieldName) {
987
+ return allIncomplete.some(function (testObject) {
988
+ return matchingFieldName(testObject, fieldName);
989
+ });
990
+ }
991
+ return isNotEmpty(allIncomplete);
992
+ }
993
+
994
994
  var cache = createCache(20);
995
995
  function produceFullResult() {
996
996
  var testObjects = useTestsFlat();
997
997
  var ctxRef = { stateRef: useStateRef() };
998
998
  return cache([testObjects], context.bind(ctxRef, function () {
999
- return assign({}, produceDraft(), {
999
+ return assign({}, produceBase(), {
1000
1000
  done: context.bind(ctxRef, done)
1001
1001
  });
1002
1002
  }));
@@ -1029,7 +1029,7 @@ var done = function done() {
1029
1029
  if (shouldSkipDoneRegistration(callback, fieldName, output)) {
1030
1030
  return output;
1031
1031
  }
1032
- var doneCallback = function () { return callback(produceDraft()); };
1032
+ var doneCallback = function () { return callback(produceBase()); };
1033
1033
  if (shouldRunDoneCallback(fieldName)) {
1034
1034
  doneCallback();
1035
1035
  return output;
@@ -1230,7 +1230,7 @@ function create() {
1230
1230
  // Return the result
1231
1231
  return produceFullResult();
1232
1232
  }), {
1233
- get: context.bind(ctxRef, produceDraft),
1233
+ get: context.bind(ctxRef, produceBase),
1234
1234
  remove: context.bind(ctxRef, function (fieldName) {
1235
1235
  bus.emit(Events.REMOVE_FIELD, fieldName);
1236
1236
  }),
@@ -1288,7 +1288,7 @@ function skipWhen(conditional, callback) {
1288
1288
  // we should skip the test if the parent conditional is true.
1289
1289
  isExcludedIndividually() ||
1290
1290
  // Otherwise, we should skip the test if the conditional is true.
1291
- optionalFunctionValue(conditional, optionalFunctionValue(produceDraft))
1291
+ optionalFunctionValue(conditional, optionalFunctionValue(produceBase))
1292
1292
  }, function () { return callback(); });
1293
1293
  });
1294
1294
  }
@@ -1488,7 +1488,7 @@ function include(fieldName) {
1488
1488
  if (isStringValue(condition)) {
1489
1489
  return Boolean(exclusion.tests[condition]);
1490
1490
  }
1491
- return optionalFunctionValue(condition, optionalFunctionValue(produceDraft));
1491
+ return optionalFunctionValue(condition, optionalFunctionValue(produceBase));
1492
1492
  };
1493
1493
  }
1494
1494
  }
@@ -1545,7 +1545,7 @@ function omitWhen(conditional, callback) {
1545
1545
  isolate({ type: IsolateTypes.OMIT_WHEN }, function () {
1546
1546
  context.run({
1547
1547
  omitted: isOmitted() ||
1548
- optionalFunctionValue(conditional, optionalFunctionValue(produceDraft))
1548
+ optionalFunctionValue(conditional, optionalFunctionValue(produceBase))
1549
1549
  }, function () { return callback(); });
1550
1550
  });
1551
1551
  }
@@ -1678,7 +1678,7 @@ function registerTest(testObject) {
1678
1678
  }
1679
1679
  }
1680
1680
  catch (e) {
1681
- throwError("Unexpected error encountered during test registration.\n Test Object: ".concat(testObject, ".\n Error: ").concat(e, "."));
1681
+ throwError("Unexpected error encountered during test registration.\n Test Object: ".concat(JSON.stringify(testObject), ".\n Error: ").concat(e, "."));
1682
1682
  }
1683
1683
  }
1684
1684
 
@@ -1877,7 +1877,7 @@ function warn() {
1877
1877
  ctx.currentTest.warn();
1878
1878
  }
1879
1879
 
1880
- var VERSION = "4.2.0";
1880
+ var VERSION = "4.2.1-dev-ee64be";
1881
1881
 
1882
1882
  Object.defineProperty(exports, 'enforce', {
1883
1883
  enumerable: true,