type-enforcer-test-helper 1.3.10 → 2.0.0-alpha.0
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/README.md +2 -156
- package/dist/js/index.js +7 -0
- package/dist/js/src/data/TestClass.js +12 -0
- package/dist/js/src/data/coercible.js +81 -0
- package/dist/js/src/data/testData.js +168 -0
- package/dist/js/src/data/testValues.js +116 -0
- package/dist/js/src/multiTest.js +116 -0
- package/dist/js/src/testCheck.js +39 -0
- package/dist/js/src/testEnforce.js +121 -0
- package/dist/js/src/testMethod.js +337 -0
- package/dist/js/src/utility/difference.js +7 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/src/data/TestClass.d.ts +6 -0
- package/dist/types/src/data/coercible.d.ts +6 -0
- package/dist/types/src/data/testData.d.ts +30 -0
- package/dist/types/src/data/testData.test.d.ts +1 -0
- package/dist/types/src/data/testValues.d.ts +19 -0
- package/dist/types/src/data/testValues.test.d.ts +1 -0
- package/dist/types/src/multiTest.d.ts +58 -0
- package/dist/types/src/multiTest.test.d.ts +1 -0
- package/dist/types/src/testCheck.d.ts +3 -0
- package/dist/types/src/testCheck.test.d.ts +1 -0
- package/dist/types/src/testEnforce.d.ts +2 -0
- package/dist/types/src/testEnforce.test.d.ts +1 -0
- package/dist/types/src/testMethod.d.ts +20 -0
- package/dist/types/src/testMethod.test.d.ts +1 -0
- package/dist/types/src/utility/difference.d.ts +2 -0
- package/dist/types/src/utility/difference.test.d.ts +1 -0
- package/package.json +24 -42
- package/index.js +0 -17
- package/src/data/TestClass.js +0 -11
- package/src/data/coercible.js +0 -85
- package/src/data/testData.js +0 -417
- package/src/data/testValues.js +0 -241
- package/src/multiTest.js +0 -125
- package/src/testCheck.js +0 -67
- package/src/testEnforce.js +0 -143
- package/src/testMethod.js +0 -439
- package/src/utility/difference.js +0 -4
- package/types/index.d.ts +0 -8
- package/types/index.d.ts.map +0 -1
- package/types/src/data/TestClass.d.ts +0 -11
- package/types/src/data/TestClass.d.ts.map +0 -1
- package/types/src/data/coercible.d.ts +0 -7
- package/types/src/data/coercible.d.ts.map +0 -1
- package/types/src/data/testData.d.ts +0 -289
- package/types/src/data/testData.d.ts.map +0 -1
- package/types/src/data/testValues.d.ts +0 -26
- package/types/src/data/testValues.d.ts.map +0 -1
- package/types/src/multiTest.d.ts +0 -14
- package/types/src/multiTest.d.ts.map +0 -1
- package/types/src/testCheck.d.ts +0 -11
- package/types/src/testCheck.d.ts.map +0 -1
- package/types/src/testEnforce.d.ts +0 -12
- package/types/src/testEnforce.d.ts.map +0 -1
- package/types/src/testMethod.d.ts +0 -27
- package/types/src/testMethod.d.ts.map +0 -1
- package/types/src/utility/difference.d.ts +0 -3
- package/types/src/utility/difference.d.ts.map +0 -1
package/src/testMethod.js
DELETED
|
@@ -1,439 +0,0 @@
|
|
|
1
|
-
import displayValue from 'display-value';
|
|
2
|
-
import { powerset } from 'object-agent';
|
|
3
|
-
import { assert } from 'type-enforcer';
|
|
4
|
-
|
|
5
|
-
const startCase = (string) => string.split(' ')
|
|
6
|
-
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
|
7
|
-
.join(' ');
|
|
8
|
-
|
|
9
|
-
const TEST_METHOD = 'testMethod';
|
|
10
|
-
const everyMethodVariant = powerset(['get', 'other', 'before', 'set'])
|
|
11
|
-
.map((combination) => {
|
|
12
|
-
return {
|
|
13
|
-
name: TEST_METHOD + combination.map(startCase).join(''),
|
|
14
|
-
options: combination
|
|
15
|
-
};
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
const processOutput = (value, options = {}) => {
|
|
19
|
-
return (options.stringify && value && value.toString) ? value.toString() : value;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
const beforeSymbol = Symbol();
|
|
23
|
-
const setSymbol = Symbol();
|
|
24
|
-
const getSymbol = Symbol();
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Test a chainable method function (methodArray, methodBoolean, etc.).
|
|
28
|
-
*
|
|
29
|
-
* @function testMethod
|
|
30
|
-
*
|
|
31
|
-
* @param {object} settings - Settings object.
|
|
32
|
-
* @param {object} settings.name - The name used in type-enforcer namespaces for this type.
|
|
33
|
-
* @param {object} settings.init - The expected value returned by the method immediately after instantiation.
|
|
34
|
-
* @param {object} settings.extraProps - An object of extra properties to be passed in when the method is instantiated.
|
|
35
|
-
* @param {Array} settings.true - An array of values that are valid for this method.
|
|
36
|
-
* @param {Array} settings.false - An array of values that are NOT valid for this method.
|
|
37
|
-
* @param {Array|false} [settings.coerce] - An array of objects with values that can be coerced by this method.
|
|
38
|
-
* @param {unknown} settings.coerce[].value - The value to be coerced.
|
|
39
|
-
* @param {unknown} settings.coerce[].coerced - The expected result of coercion.
|
|
40
|
-
* @param {Array} settings.coerceTrue - Alternatively, an array of values that are coercible by this method.
|
|
41
|
-
* @param {Function} thisMethod - The function to test.
|
|
42
|
-
* @param {object} method - An object that includes this function.
|
|
43
|
-
*/
|
|
44
|
-
export default function(settings, thisMethod, method) {
|
|
45
|
-
let testBefore = '';
|
|
46
|
-
let testSet = '';
|
|
47
|
-
let self = this;
|
|
48
|
-
|
|
49
|
-
const testBeforeCallback = function(oldValue) {
|
|
50
|
-
self = this;
|
|
51
|
-
testBefore = processOutput(oldValue, settings.extraProps);
|
|
52
|
-
};
|
|
53
|
-
const testSetCallback = function(newValue) {
|
|
54
|
-
self = this;
|
|
55
|
-
testSet = processOutput(newValue, settings.extraProps);
|
|
56
|
-
};
|
|
57
|
-
const testGetCallback = function() {
|
|
58
|
-
self = this;
|
|
59
|
-
return settings.init;
|
|
60
|
-
};
|
|
61
|
-
const testGetCallbackWithTestItem = function() {
|
|
62
|
-
self = this;
|
|
63
|
-
return settings.true[0];
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
beforeEach(() => {
|
|
67
|
-
testBefore = null;
|
|
68
|
-
testSet = null;
|
|
69
|
-
self = null; // eslint-disable-line consistent-this
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
const runTests = (TestConstructor, init, testItem, coerce) => {
|
|
73
|
-
everyMethodVariant.forEach((methodData) => {
|
|
74
|
-
const methodName = methodData.name;
|
|
75
|
-
const hasGet = methodData.options.includes('get');
|
|
76
|
-
const hasOther = methodData.options.includes('other');
|
|
77
|
-
const hasBefore = methodData.options.includes('before');
|
|
78
|
-
const hasSet = methodData.options.includes('set');
|
|
79
|
-
|
|
80
|
-
describe('(' + methodName.replace('testMethod', '') + ')', () => {
|
|
81
|
-
it('should return the init value', () => {
|
|
82
|
-
const testConstructor = new TestConstructor();
|
|
83
|
-
|
|
84
|
-
assert.equal(testConstructor[methodName](), init);
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
it('should return "this" after a value is set', () => {
|
|
88
|
-
const testConstructor = new TestConstructor();
|
|
89
|
-
|
|
90
|
-
const that = testConstructor[methodName](testItem);
|
|
91
|
-
|
|
92
|
-
assert.is(that, testConstructor);
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
if (hasGet) {
|
|
96
|
-
it('should return whatever the "get" callback returns', () => {
|
|
97
|
-
const testConstructor = new TestConstructor();
|
|
98
|
-
|
|
99
|
-
testConstructor[methodName](testItem);
|
|
100
|
-
|
|
101
|
-
assert.equal(testConstructor[methodName](), init);
|
|
102
|
-
assert.is(testConstructor, self);
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
else {
|
|
106
|
-
it('should return a set value', () => {
|
|
107
|
-
const testConstructor = new TestConstructor();
|
|
108
|
-
|
|
109
|
-
testConstructor[methodName](testItem);
|
|
110
|
-
|
|
111
|
-
assert.equal(testConstructor[methodName](), testItem);
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
if (hasSet) {
|
|
116
|
-
it('should execute the "set" callback when the value is set', () => {
|
|
117
|
-
const testConstructor = new TestConstructor();
|
|
118
|
-
testSet = '';
|
|
119
|
-
|
|
120
|
-
testConstructor[methodName](testItem);
|
|
121
|
-
|
|
122
|
-
assert.equal(testSet, testItem);
|
|
123
|
-
assert.is(testConstructor, self);
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
it('should execute the "set" callback when the value is set to the current value and a second parameter of "true" is provided', () => {
|
|
127
|
-
const testConstructor = new TestConstructor();
|
|
128
|
-
testSet = '';
|
|
129
|
-
|
|
130
|
-
testConstructor[methodName](testItem);
|
|
131
|
-
testSet = '';
|
|
132
|
-
testConstructor[methodName](testItem, true);
|
|
133
|
-
|
|
134
|
-
assert.equal(testSet, testItem);
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
if (!hasGet) {
|
|
138
|
-
it('should NOT execute the "set" callback when the value is set to the current value', () => {
|
|
139
|
-
const testConstructor = new TestConstructor();
|
|
140
|
-
testSet = '';
|
|
141
|
-
|
|
142
|
-
testConstructor[methodName](testItem);
|
|
143
|
-
testSet = '';
|
|
144
|
-
testConstructor[methodName](testItem);
|
|
145
|
-
|
|
146
|
-
assert.equal(testSet, '');
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
if (hasBefore) {
|
|
152
|
-
it('should call the "before" callback with the init value when a value is set', () => {
|
|
153
|
-
const testConstructor = new TestConstructor();
|
|
154
|
-
testBefore = '';
|
|
155
|
-
|
|
156
|
-
testConstructor[methodName](testItem);
|
|
157
|
-
|
|
158
|
-
assert.equal(testBefore, init);
|
|
159
|
-
assert.is(testConstructor, self);
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
if (hasOther) {
|
|
164
|
-
it('should be able to be set to other', () => {
|
|
165
|
-
const testConstructor = new TestConstructor();
|
|
166
|
-
|
|
167
|
-
if (!hasBefore && !hasGet) {
|
|
168
|
-
testConstructor[methodName](undefined);
|
|
169
|
-
|
|
170
|
-
assert.equal(testConstructor[methodName](), undefined);
|
|
171
|
-
}
|
|
172
|
-
else if (hasSet && init) {
|
|
173
|
-
testSet = '';
|
|
174
|
-
|
|
175
|
-
testConstructor[methodName](undefined);
|
|
176
|
-
|
|
177
|
-
assert.equal(testSet, undefined);
|
|
178
|
-
}
|
|
179
|
-
else if (hasBefore && !hasGet && init) {
|
|
180
|
-
testBefore = '';
|
|
181
|
-
|
|
182
|
-
testConstructor[methodName](undefined);
|
|
183
|
-
testConstructor[methodName](testItem);
|
|
184
|
-
|
|
185
|
-
assert.equal(testBefore, undefined);
|
|
186
|
-
}
|
|
187
|
-
else if (hasBefore && hasGet && init) {
|
|
188
|
-
testBefore = '';
|
|
189
|
-
|
|
190
|
-
testConstructor[methodName](undefined);
|
|
191
|
-
|
|
192
|
-
assert.equal(testBefore, init);
|
|
193
|
-
}
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
coerce.forEach((item) => {
|
|
198
|
-
if (!hasGet) {
|
|
199
|
-
it('should coerce ' + displayValue(item.value) + ' to ' + displayValue(item.coerced), () => {
|
|
200
|
-
const testConstructor = new TestConstructor();
|
|
201
|
-
|
|
202
|
-
testConstructor[methodName](item.value);
|
|
203
|
-
|
|
204
|
-
assert.equal(testConstructor[methodName](), item.coerced);
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
else if (hasSet) {
|
|
208
|
-
it('should coerce ' + displayValue(item.value) + ' to ' + displayValue(item.coerced), () => {
|
|
209
|
-
const testConstructor = new TestConstructor();
|
|
210
|
-
testSet = '';
|
|
211
|
-
|
|
212
|
-
testConstructor[methodName](item.value);
|
|
213
|
-
|
|
214
|
-
assert.equal(testSet, item.coerced);
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
});
|
|
218
|
-
});
|
|
219
|
-
});
|
|
220
|
-
|
|
221
|
-
it('should not set the value of another method with the same variant', () => {
|
|
222
|
-
const testConstructor = new TestConstructor();
|
|
223
|
-
|
|
224
|
-
testConstructor[TEST_METHOD](testItem);
|
|
225
|
-
|
|
226
|
-
assert.equal(testConstructor[TEST_METHOD](), testItem);
|
|
227
|
-
assert.equal(testConstructor[TEST_METHOD + '2'](), init);
|
|
228
|
-
});
|
|
229
|
-
};
|
|
230
|
-
|
|
231
|
-
const getOptionCallback = (option, withTestItem, isReassigned, isSymbol) => {
|
|
232
|
-
if (isSymbol) {
|
|
233
|
-
switch (option) {
|
|
234
|
-
case 'get':
|
|
235
|
-
return withTestItem ? testGetCallbackWithTestItem : getSymbol;
|
|
236
|
-
case 'other':
|
|
237
|
-
return undefined;
|
|
238
|
-
case 'before':
|
|
239
|
-
return beforeSymbol;
|
|
240
|
-
case 'set':
|
|
241
|
-
return setSymbol;
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
if (isReassigned) {
|
|
245
|
-
switch (option) {
|
|
246
|
-
case 'get':
|
|
247
|
-
return withTestItem ? testGetCallbackWithTestItem : 'testGetCallback';
|
|
248
|
-
case 'other':
|
|
249
|
-
return undefined;
|
|
250
|
-
case 'before':
|
|
251
|
-
return 'testBeforeCallback';
|
|
252
|
-
case 'set':
|
|
253
|
-
return 'testSetCallback';
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
switch (option) {
|
|
257
|
-
case 'get':
|
|
258
|
-
return withTestItem ? testGetCallbackWithTestItem : testGetCallback;
|
|
259
|
-
case 'other':
|
|
260
|
-
return undefined;
|
|
261
|
-
case 'before':
|
|
262
|
-
return testBeforeCallback;
|
|
263
|
-
case 'set':
|
|
264
|
-
return testSetCallback;
|
|
265
|
-
}
|
|
266
|
-
};
|
|
267
|
-
|
|
268
|
-
const addMethodsTo = (applyTo, extraProperties = {}, isReassigned = false, isSymbol = false) => {
|
|
269
|
-
everyMethodVariant.forEach((methodData) => {
|
|
270
|
-
const options = {
|
|
271
|
-
...settings.extraProps,
|
|
272
|
-
...extraProperties
|
|
273
|
-
};
|
|
274
|
-
|
|
275
|
-
methodData.options.forEach((option) => {
|
|
276
|
-
options[option] = getOptionCallback(option, extraProperties.init, isReassigned, isSymbol);
|
|
277
|
-
});
|
|
278
|
-
|
|
279
|
-
applyTo[methodData.name] = method[settings.name](options);
|
|
280
|
-
});
|
|
281
|
-
|
|
282
|
-
applyTo[TEST_METHOD + '2'] = method[settings.name]({
|
|
283
|
-
...settings.extraProps,
|
|
284
|
-
...extraProperties
|
|
285
|
-
});
|
|
286
|
-
};
|
|
287
|
-
|
|
288
|
-
it('should exist in the exported "method" object', () => {
|
|
289
|
-
assert.equal(thisMethod, method[settings.name]);
|
|
290
|
-
});
|
|
291
|
-
|
|
292
|
-
describe('(prototype)', () => {
|
|
293
|
-
class TestConstructor1 {
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
addMethodsTo(TestConstructor1.prototype);
|
|
297
|
-
|
|
298
|
-
runTests(TestConstructor1, settings.init, settings.true[0], settings.coerce || []);
|
|
299
|
-
});
|
|
300
|
-
|
|
301
|
-
describe('(prototype) (reassigned methods string property)', () => {
|
|
302
|
-
class TestConstructor1 {
|
|
303
|
-
constructor() {
|
|
304
|
-
this.testBeforeCallback = testBeforeCallback;
|
|
305
|
-
this.testSetCallback = testSetCallback;
|
|
306
|
-
this.testGetCallback = testGetCallback;
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
addMethodsTo(TestConstructor1.prototype, {}, true);
|
|
311
|
-
|
|
312
|
-
runTests(TestConstructor1, settings.init, settings.true[0], settings.coerce || []);
|
|
313
|
-
});
|
|
314
|
-
|
|
315
|
-
describe('(prototype) (reassigned methods symbol property)', () => {
|
|
316
|
-
class TestConstructor1 {
|
|
317
|
-
constructor() {
|
|
318
|
-
this[beforeSymbol] = testBeforeCallback;
|
|
319
|
-
this[setSymbol] = testSetCallback;
|
|
320
|
-
this[getSymbol] = testGetCallback;
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
addMethodsTo(TestConstructor1.prototype, {}, true, true);
|
|
325
|
-
|
|
326
|
-
runTests(TestConstructor1, settings.init, settings.true[0], settings.coerce || []);
|
|
327
|
-
});
|
|
328
|
-
|
|
329
|
-
describe('(prototype) (reassigned method string proto)', () => {
|
|
330
|
-
class TestConstructor1 {
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
Object.assign(TestConstructor1.prototype, {
|
|
334
|
-
testBeforeCallback,
|
|
335
|
-
testSetCallback,
|
|
336
|
-
testGetCallback
|
|
337
|
-
});
|
|
338
|
-
|
|
339
|
-
addMethodsTo(TestConstructor1.prototype, {}, true);
|
|
340
|
-
|
|
341
|
-
runTests(TestConstructor1, settings.init, settings.true[0], settings.coerce || []);
|
|
342
|
-
});
|
|
343
|
-
|
|
344
|
-
describe('(prototype) (reassigned method symbol proto)', () => {
|
|
345
|
-
class TestConstructor1 {
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
Object.assign(TestConstructor1.prototype, {
|
|
349
|
-
[beforeSymbol]: testBeforeCallback,
|
|
350
|
-
[setSymbol]: testSetCallback,
|
|
351
|
-
[getSymbol]: testGetCallback
|
|
352
|
-
});
|
|
353
|
-
|
|
354
|
-
addMethodsTo(TestConstructor1.prototype, {}, true, true);
|
|
355
|
-
|
|
356
|
-
runTests(TestConstructor1, settings.init, settings.true[0], settings.coerce || []);
|
|
357
|
-
});
|
|
358
|
-
|
|
359
|
-
describe('(prototype) (init)', () => {
|
|
360
|
-
class TestConstructor2 {
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
addMethodsTo(TestConstructor2.prototype, {
|
|
364
|
-
init: settings.true[0]
|
|
365
|
-
});
|
|
366
|
-
|
|
367
|
-
runTests(TestConstructor2, settings.true[0], settings.true[1], settings.coerce || []);
|
|
368
|
-
|
|
369
|
-
settings.false.forEach((falseValue) => {
|
|
370
|
-
it(`should return ${ displayValue(settings.true[0]) } after attempting to set to ${ displayValue(falseValue) }`, () => {
|
|
371
|
-
const testConstructor = new TestConstructor2();
|
|
372
|
-
|
|
373
|
-
testConstructor.testMethod(falseValue);
|
|
374
|
-
|
|
375
|
-
assert.equal(testConstructor.testMethod(), settings.true[0]);
|
|
376
|
-
});
|
|
377
|
-
});
|
|
378
|
-
});
|
|
379
|
-
|
|
380
|
-
describe('(property)', () => {
|
|
381
|
-
const TestConstructor3 = function() {
|
|
382
|
-
addMethodsTo(this);
|
|
383
|
-
};
|
|
384
|
-
|
|
385
|
-
runTests(TestConstructor3, settings.init, settings.true[0], settings.coerce || []);
|
|
386
|
-
});
|
|
387
|
-
|
|
388
|
-
describe('(property) (init)', () => {
|
|
389
|
-
const TestConstructor4 = function() {
|
|
390
|
-
addMethodsTo(this, {
|
|
391
|
-
init: settings.true[0]
|
|
392
|
-
});
|
|
393
|
-
};
|
|
394
|
-
|
|
395
|
-
runTests(TestConstructor4, settings.true[0], settings.true[1], settings.coerce || []);
|
|
396
|
-
});
|
|
397
|
-
|
|
398
|
-
if (settings.coerce !== false) {
|
|
399
|
-
describe('(prototype) (coerce=true)', () => {
|
|
400
|
-
class TestConstructor2 {
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
addMethodsTo(TestConstructor2.prototype, {
|
|
404
|
-
init: undefined,
|
|
405
|
-
coerce: true
|
|
406
|
-
});
|
|
407
|
-
|
|
408
|
-
settings.coerceTrue.forEach((value) => {
|
|
409
|
-
it(`should return coerced ${ displayValue(value) } after attempting to set to ${ displayValue(value) }`, () => {
|
|
410
|
-
const testConstructor = new TestConstructor2();
|
|
411
|
-
|
|
412
|
-
testConstructor.testMethod(value);
|
|
413
|
-
|
|
414
|
-
assert.notIs(testConstructor.testMethod(), undefined);
|
|
415
|
-
});
|
|
416
|
-
});
|
|
417
|
-
});
|
|
418
|
-
|
|
419
|
-
describe('(prototype) (coerce=false)', () => {
|
|
420
|
-
class TestConstructor2 {
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
addMethodsTo(TestConstructor2.prototype, {
|
|
424
|
-
init: undefined,
|
|
425
|
-
coerce: false
|
|
426
|
-
});
|
|
427
|
-
|
|
428
|
-
settings.coerceTrue.forEach((value) => {
|
|
429
|
-
it(`should return coerced ${ displayValue(value) } after attempting to set to ${ displayValue(value) }`, () => {
|
|
430
|
-
const testConstructor = new TestConstructor2();
|
|
431
|
-
|
|
432
|
-
testConstructor.testMethod(value);
|
|
433
|
-
|
|
434
|
-
assert.is(testConstructor.testMethod(), undefined);
|
|
435
|
-
});
|
|
436
|
-
});
|
|
437
|
-
});
|
|
438
|
-
}
|
|
439
|
-
}
|
package/types/index.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export * from "./src/data/testValues.js";
|
|
2
|
-
export * from "./src/data/testData.js";
|
|
3
|
-
export { default as TestClass } from "./src/data/TestClass.js";
|
|
4
|
-
export { default as multiTest } from "./src/multiTest.js";
|
|
5
|
-
export { default as testCheck } from "./src/testCheck.js";
|
|
6
|
-
export { default as testEnforce } from "./src/testEnforce.js";
|
|
7
|
-
export { default as testMethod } from "./src/testMethod.js";
|
|
8
|
-
//# sourceMappingURL=index.d.ts.map
|
package/types/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.js"],"names":[],"mappings":""}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @class TestClass
|
|
3
|
-
* @classdesc A simple class for testing things like instanceof
|
|
4
|
-
*
|
|
5
|
-
* @param {unknown} value - Adds a property "value" to an instance of TestClass, set to the value provided.
|
|
6
|
-
*/
|
|
7
|
-
export default class TestClass {
|
|
8
|
-
constructor(value: any);
|
|
9
|
-
value: any;
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=TestClass.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TestClass.d.ts","sourceRoot":"","sources":["../../../src/data/TestClass.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH;IACC,wBAEC;IADA,WAAkB;CAEnB"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export const coerceArrayTrue: string[];
|
|
2
|
-
export const coerceInfinity: string[];
|
|
3
|
-
export const coerceIntegerTrue: string[];
|
|
4
|
-
export const coerceFloatTrue: string[];
|
|
5
|
-
export const coerceNumberFalse: (string | number)[];
|
|
6
|
-
export const coerceObjectTrue: string[];
|
|
7
|
-
//# sourceMappingURL=coercible.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"coercible.d.ts","sourceRoot":"","sources":["../../../src/data/coercible.js"],"names":[],"mappings":"AAAA,uCAAkD;AAElD,sCAGE;AAEF,yCAuBO;AAEP,uCAGE;AAEF,oDA6CE;AAEF,wCAA0D"}
|