@coderzz/mocker-data-generator 3.0.5 → 3.0.7
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/CHANGELOG.md +43 -0
- package/LICENSE +0 -0
- package/README.md +0 -0
- package/build/main/array-includes.d.ts +0 -0
- package/build/main/array-includes.js +45 -45
- package/build/main/index.d.ts +7 -7
- package/build/main/index.js +12 -12
- package/build/main/index.spec.d.ts +1 -1
- package/build/main/index.spec.js +16 -16
- package/build/main/lib/Generator.d.ts +61 -61
- package/build/main/lib/Generator.js +134 -134
- package/build/main/lib/Mocker.d.ts +22 -22
- package/build/main/lib/Mocker.js +76 -76
- package/build/main/lib/Schema.d.ts +9 -9
- package/build/main/lib/Schema.js +210 -210
- package/build/main/lib/types.d.ts +8 -8
- package/build/main/lib/types.js +2 -2
- package/build/main/lib/utils.d.ts +10 -10
- package/build/main/lib/utils.js +222 -222
- package/build/main/tests/Generator.db.spec.d.ts +1 -1
- package/build/main/tests/Generator.db.spec.js +33 -33
- package/build/main/tests/Generator.eval.spec.d.ts +1 -1
- package/build/main/tests/Generator.eval.spec.js +21 -21
- package/build/main/tests/Generator.function.spec.d.ts +1 -1
- package/build/main/tests/Generator.function.spec.js +48 -48
- package/build/main/tests/Generator.generator.spec.d.ts +1 -1
- package/build/main/tests/Generator.generator.spec.js +187 -187
- package/build/main/tests/Generator.hasMany.spec.d.ts +1 -1
- package/build/main/tests/Generator.hasMany.spec.js +115 -115
- package/build/main/tests/Generator.hasOne.spec.d.ts +1 -1
- package/build/main/tests/Generator.hasOne.spec.js +146 -146
- package/build/main/tests/Generator.incrementalId.spec.d.ts +1 -1
- package/build/main/tests/Generator.incrementalId.spec.js +26 -26
- package/build/main/tests/Generator.self.spec.d.ts +1 -1
- package/build/main/tests/Generator.self.spec.js +24 -24
- package/build/main/tests/Generator.static.spec.d.ts +1 -1
- package/build/main/tests/Generator.static.spec.js +15 -15
- package/build/main/tests/Generator.values.spec.d.ts +1 -1
- package/build/main/tests/Generator.values.spec.js +16 -16
- package/build/main/tests/Mocker.build.spec.d.ts +1 -1
- package/build/main/tests/Mocker.build.spec.js +196 -196
- package/build/main/tests/Mocker.reset.spec.d.ts +1 -1
- package/build/main/tests/Mocker.reset.spec.js +17 -17
- package/build/main/tests/Mocker.restart.spec.d.ts +1 -1
- package/build/main/tests/Mocker.restart.spec.js +24 -24
- package/build/main/tests/Mocker.schema.spec.d.ts +1 -1
- package/build/main/tests/Mocker.schema.spec.js +18 -18
- package/build/main/tests/Mocker.seed.spec.d.ts +1 -1
- package/build/main/tests/Mocker.seed.spec.js +42 -42
- package/build/main/tests/Schema.Array.spec.d.ts +1 -1
- package/build/main/tests/Schema.Array.spec.js +332 -332
- package/build/main/tests/Schema.BuildSingle.spec.d.ts +1 -1
- package/build/main/tests/Schema.BuildSingle.spec.js +13 -13
- package/build/main/tests/mocker.spec.d.ts +1 -1
- package/build/main/tests/mocker.spec.js +405 -405
- package/build/module/array-includes.js +45 -45
- package/build/module/index.js +7 -7
- package/build/module/lib/Generator.js +131 -131
- package/build/module/lib/Mocker.js +73 -73
- package/build/module/lib/Schema.js +207 -207
- package/build/module/lib/types.js +1 -1
- package/build/module/lib/utils.js +209 -209
- package/package.json +1 -1
@@ -1,42 +1,42 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
var tslib_1 = require("tslib");
|
4
|
-
var ava_1 = require("ava");
|
5
|
-
var __1 = require("..");
|
6
|
-
var cats = [
|
7
|
-
{
|
8
|
-
name: 'Luke'
|
9
|
-
},
|
10
|
-
{
|
11
|
-
name: 'Leia'
|
12
|
-
}
|
13
|
-
];
|
14
|
-
var mock = new __1.Mocker();
|
15
|
-
(0, ava_1.default)('Should seed data', function (t) { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
|
16
|
-
return tslib_1.__generator(this, function (_a) {
|
17
|
-
t.true(Object.keys(mock.DB).length === 0);
|
18
|
-
mock.seed('cats', cats);
|
19
|
-
t.true(Object.keys(mock.DB).length > 0);
|
20
|
-
t.deepEqual(mock.DB.cats, cats);
|
21
|
-
return [2 /*return*/];
|
22
|
-
});
|
23
|
-
}); });
|
24
|
-
(0, ava_1.default)('Should merge data from seed', function (t) { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
|
25
|
-
var mock;
|
26
|
-
return tslib_1.__generator(this, function (_a) {
|
27
|
-
switch (_a.label) {
|
28
|
-
case 0: return [4 /*yield*/, (0, __1.default)()
|
29
|
-
.seed('cats', cats)
|
30
|
-
.schema('cats', {
|
31
|
-
name: {
|
32
|
-
values: ['txuri', 'pitxi', 'kitty']
|
33
|
-
}
|
34
|
-
}, 1)
|
35
|
-
.build()];
|
36
|
-
case 1:
|
37
|
-
mock = _a.sent();
|
38
|
-
t.true(mock.cats.length === 3);
|
39
|
-
return [2 /*return*/];
|
40
|
-
}
|
41
|
-
});
|
42
|
-
}); });
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
var tslib_1 = require("tslib");
|
4
|
+
var ava_1 = require("ava");
|
5
|
+
var __1 = require("..");
|
6
|
+
var cats = [
|
7
|
+
{
|
8
|
+
name: 'Luke'
|
9
|
+
},
|
10
|
+
{
|
11
|
+
name: 'Leia'
|
12
|
+
}
|
13
|
+
];
|
14
|
+
var mock = new __1.Mocker();
|
15
|
+
(0, ava_1.default)('Should seed data', function (t) { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
|
16
|
+
return tslib_1.__generator(this, function (_a) {
|
17
|
+
t.true(Object.keys(mock.DB).length === 0);
|
18
|
+
mock.seed('cats', cats);
|
19
|
+
t.true(Object.keys(mock.DB).length > 0);
|
20
|
+
t.deepEqual(mock.DB.cats, cats);
|
21
|
+
return [2 /*return*/];
|
22
|
+
});
|
23
|
+
}); });
|
24
|
+
(0, ava_1.default)('Should merge data from seed', function (t) { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
|
25
|
+
var mock;
|
26
|
+
return tslib_1.__generator(this, function (_a) {
|
27
|
+
switch (_a.label) {
|
28
|
+
case 0: return [4 /*yield*/, (0, __1.default)()
|
29
|
+
.seed('cats', cats)
|
30
|
+
.schema('cats', {
|
31
|
+
name: {
|
32
|
+
values: ['txuri', 'pitxi', 'kitty']
|
33
|
+
}
|
34
|
+
}, 1)
|
35
|
+
.build()];
|
36
|
+
case 1:
|
37
|
+
mock = _a.sent();
|
38
|
+
t.true(mock.cats.length === 3);
|
39
|
+
return [2 /*return*/];
|
40
|
+
}
|
41
|
+
});
|
42
|
+
}); });
|
@@ -1 +1 @@
|
|
1
|
-
export {};
|
1
|
+
export {};
|