make-mp-data 1.4.4 → 1.4.5
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/.vscode/settings.json +1 -0
- package/core/index.js +24 -19
- package/core/utils.js +134 -77
- package/dungeons/.gitkeep +0 -0
- package/package.json +5 -5
- package/schemas/anon.js +2 -2
- package/schemas/complex.js +22 -22
- package/schemas/foobar.js +2 -2
- package/schemas/funnels.js +10 -10
- package/schemas/simple.js +16 -30
- package/scratch.mjs +4 -7
- package/scripts/new.sh +52 -0
- package/tests/coverage/.gitkeep +0 -0
- package/tests/e2e.test.js +4 -22
- package/tests/jest.config.js +3 -2
- package/tests/unit.test.js +327 -207
- package/types.d.ts +157 -80
- package/schemas/deepNest.js +0 -106
package/schemas/foobar.js
CHANGED
|
@@ -14,7 +14,7 @@ const dayjs = require("dayjs");
|
|
|
14
14
|
const utc = require("dayjs/plugin/utc");
|
|
15
15
|
dayjs.extend(utc);
|
|
16
16
|
const { uid, comma } = require('ak-tools');
|
|
17
|
-
const { pickAWinner,
|
|
17
|
+
const { pickAWinner, weighNumRange, date, integer } = require('../core/utils');
|
|
18
18
|
|
|
19
19
|
const itemCategories = ["Books", "Movies", "Music", "Games", "Electronics", "Computers", "Smart Home", "Home", "Garden", "Pet", "Beauty", "Health", "Toys", "Kids", "Baby", "Handmade", "Sports", "Outdoors", "Automotive", "Industrial", "Entertainment", "Art", "Food", "Appliances", "Office", "Wedding", "Software"];
|
|
20
20
|
|
|
@@ -91,7 +91,7 @@ const config = {
|
|
|
91
91
|
},
|
|
92
92
|
userProps: {
|
|
93
93
|
title: chance.profession.bind(chance),
|
|
94
|
-
luckyNumber:
|
|
94
|
+
luckyNumber: weighNumRange(42, 420),
|
|
95
95
|
spiritAnimal: ["duck", "dog", "otter", "penguin", "cat", "elephant", "lion", "cheetah", "giraffe", "zebra", "rhino", "hippo", "whale", "dolphin", "shark", "octopus", "squid", "jellyfish", "starfish", "seahorse", "crab", "lobster", "shrimp", "clam", "snail", "slug", "butterfly", "moth", "bee", "wasp", "ant", "beetle", "ladybug", "caterpillar", "centipede", "millipede", "scorpion", "spider", "tarantula", "tick", "mite", "mosquito", "fly", "dragonfly", "damselfly", "grasshopper", "cricket", "locust", "mantis", "cockroach", "termite", "praying mantis", "walking stick", "stick bug", "leaf insect", "lacewing", "aphid", "cicada", "thrips", "psyllid", "scale insect", "whitefly", "mealybug", "planthopper", "leafhopper", "treehopper", "flea", "louse", "bedbug", "flea beetle", "weevil", "longhorn beetle", "leaf beetle", "tiger beetle", "ground beetle", "lady beetle", "firefly", "click beetle", "rove beetle", "scarab beetle", "dung beetle", "stag beetle", "rhinoceros beetle", "hercules beetle", "goliath beetle", "jewel beetle", "tortoise beetle"]
|
|
96
96
|
},
|
|
97
97
|
|
package/schemas/funnels.js
CHANGED
|
@@ -14,7 +14,7 @@ const dayjs = require("dayjs");
|
|
|
14
14
|
const utc = require("dayjs/plugin/utc");
|
|
15
15
|
dayjs.extend(utc);
|
|
16
16
|
const { uid, comma } = require('ak-tools');
|
|
17
|
-
const { pickAWinner,
|
|
17
|
+
const { pickAWinner, weighNumRange, date, integer } = require('../core/utils');
|
|
18
18
|
|
|
19
19
|
const itemCategories = ["Books", "Movies", "Music", "Games", "Electronics", "Computers", "Smart Home", "Home", "Garden", "Pet", "Beauty", "Health", "Toys", "Kids", "Baby", "Handmade", "Sports", "Outdoors", "Automotive", "Industrial", "Entertainment", "Art", "Food", "Appliances", "Office", "Wedding", "Software"];
|
|
20
20
|
|
|
@@ -37,10 +37,10 @@ const config = {
|
|
|
37
37
|
event: "checkout",
|
|
38
38
|
weight: 2,
|
|
39
39
|
properties: {
|
|
40
|
-
amount:
|
|
40
|
+
amount: weighNumRange(5, 500, .25),
|
|
41
41
|
currency: ["USD", "CAD", "EUR", "BTC", "ETH", "JPY"],
|
|
42
42
|
coupon: ["none", "none", "none", "none", "10%OFF", "20%OFF", "10%OFF", "20%OFF", "30%OFF", "40%OFF", "50%OFF"],
|
|
43
|
-
numItems:
|
|
43
|
+
numItems: weighNumRange(1, 10),
|
|
44
44
|
|
|
45
45
|
}
|
|
46
46
|
},
|
|
@@ -48,9 +48,9 @@ const config = {
|
|
|
48
48
|
event: "add to cart",
|
|
49
49
|
weight: 4,
|
|
50
50
|
properties: {
|
|
51
|
-
amount:
|
|
52
|
-
rating:
|
|
53
|
-
reviews:
|
|
51
|
+
amount: weighNumRange(5, 500, .25),
|
|
52
|
+
rating: weighNumRange(1, 5),
|
|
53
|
+
reviews: weighNumRange(0, 35),
|
|
54
54
|
isFeaturedItem: [true, false, false],
|
|
55
55
|
itemCategory: pickAWinner(itemCategories, integer(0, 27)),
|
|
56
56
|
dateItemListed: date(30, true, 'YYYY-MM-DD'),
|
|
@@ -71,7 +71,7 @@ const config = {
|
|
|
71
71
|
properties: {
|
|
72
72
|
videoCategory: pickAWinner(videoCategories, integer(0, 9)),
|
|
73
73
|
isFeaturedItem: [true, false, false],
|
|
74
|
-
watchTimeSec:
|
|
74
|
+
watchTimeSec: weighNumRange(10, 600, .25),
|
|
75
75
|
quality: ["2160p", "1440p", "1080p", "720p", "480p", "360p", "240p"],
|
|
76
76
|
format: ["mp4", "avi", "mov", "mpg"],
|
|
77
77
|
uploader_id: chance.guid.bind(chance)
|
|
@@ -182,20 +182,20 @@ const config = {
|
|
|
182
182
|
*/
|
|
183
183
|
userProps: {
|
|
184
184
|
title: chance.profession.bind(chance),
|
|
185
|
-
luckyNumber:
|
|
185
|
+
luckyNumber: weighNumRange(42, 420),
|
|
186
186
|
spiritAnimal: ["duck", "dog", "otter", "penguin", "cat", "elephant", "lion", "cheetah", "giraffe", "zebra", "rhino", "hippo", "whale", "dolphin", "shark", "octopus", "squid", "jellyfish", "starfish", "seahorse", "crab", "lobster", "shrimp", "clam", "snail", "slug", "butterfly", "moth", "bee", "wasp", "ant", "beetle", "ladybug", "caterpillar", "centipede", "millipede", "scorpion", "spider", "tarantula", "tick", "mite", "mosquito", "fly", "dragonfly", "damselfly", "grasshopper", "cricket", "locust", "mantis", "cockroach", "termite", "praying mantis", "walking stick", "stick bug", "leaf insect", "lacewing", "aphid", "cicada", "thrips", "psyllid", "scale insect", "whitefly", "mealybug", "planthopper", "leafhopper", "treehopper", "flea", "louse", "bedbug", "flea beetle", "weevil", "longhorn beetle", "leaf beetle", "tiger beetle", "ground beetle", "lady beetle", "firefly", "click beetle", "rove beetle", "scarab beetle", "dung beetle", "stag beetle", "rhinoceros beetle", "hercules beetle", "goliath beetle", "jewel beetle", "tortoise beetle"]
|
|
187
187
|
},
|
|
188
188
|
|
|
189
189
|
scdProps: {
|
|
190
190
|
nps: [1, 1, 1, 4, 4, 4, 5, 5, 6, 7, 8, 9],
|
|
191
|
-
mrr: () => {
|
|
191
|
+
mrr: () => { weighNumRange(10, 1000, .25); },
|
|
192
192
|
},
|
|
193
193
|
mirrorProps: {
|
|
194
194
|
isBot: { events: "*", values: [false, false, false, false, true] },
|
|
195
195
|
profit: { events: ["checkout"], values: [4, 2, 42] },
|
|
196
196
|
watchTimeSec: {
|
|
197
197
|
events: ["watch video"],
|
|
198
|
-
values:
|
|
198
|
+
values: weighNumRange(50, 1200, 6)
|
|
199
199
|
}
|
|
200
200
|
|
|
201
201
|
},
|
package/schemas/simple.js
CHANGED
|
@@ -14,7 +14,7 @@ const dayjs = require("dayjs");
|
|
|
14
14
|
const utc = require("dayjs/plugin/utc");
|
|
15
15
|
dayjs.extend(utc);
|
|
16
16
|
const { uid, comma } = require('ak-tools');
|
|
17
|
-
const { pickAWinner,
|
|
17
|
+
const { pickAWinner, weighNumRange, date, integer, weighChoices } = require('../core/utils');
|
|
18
18
|
|
|
19
19
|
const itemCategories = ["Books", "Movies", "Music", "Games", "Electronics", "Computers", "Smart Home", "Home", "Garden", "Pet", "Beauty", "Health", "Toys", "Kids", "Baby", "Handmade", "Sports", "Outdoors", "Automotive", "Industrial", "Entertainment", "Art", "Food", "Appliances", "Office", "Wedding", "Software"];
|
|
20
20
|
|
|
@@ -40,17 +40,17 @@ const config = {
|
|
|
40
40
|
hasBrowser: true,
|
|
41
41
|
hasCampaigns: true,
|
|
42
42
|
isAnonymous: false,
|
|
43
|
-
|
|
43
|
+
|
|
44
44
|
|
|
45
45
|
events: [
|
|
46
46
|
{
|
|
47
47
|
event: "checkout",
|
|
48
48
|
weight: 2,
|
|
49
49
|
properties: {
|
|
50
|
-
amount:
|
|
51
|
-
currency: ["USD", "CAD", "EUR", "BTC", "ETH", "JPY"],
|
|
52
|
-
coupon: ["none", "none", "none", "none", "10%OFF", "20%OFF", "10%OFF", "20%OFF", "30%OFF", "40%OFF", "50%OFF"],
|
|
53
|
-
numItems:
|
|
50
|
+
amount: weighNumRange(5, 500, .25),
|
|
51
|
+
currency: pickAWinner(["USD", "CAD", "EUR", "BTC", "ETH", "JPY"], 0),
|
|
52
|
+
coupon: weighChoices(["none", "none", "none", "none", "10%OFF", "20%OFF", "10%OFF", "20%OFF", "30%OFF", "40%OFF", "50%OFF"]),
|
|
53
|
+
numItems: weighNumRange(1, 10),
|
|
54
54
|
|
|
55
55
|
}
|
|
56
56
|
},
|
|
@@ -58,21 +58,20 @@ const config = {
|
|
|
58
58
|
event: "add to cart",
|
|
59
59
|
weight: 4,
|
|
60
60
|
properties: {
|
|
61
|
-
amount:
|
|
62
|
-
rating:
|
|
63
|
-
reviews:
|
|
61
|
+
amount: weighNumRange(5, 500, .25),
|
|
62
|
+
rating: weighNumRange(1, 5),
|
|
63
|
+
reviews: weighNumRange(0, 35),
|
|
64
64
|
isFeaturedItem: [true, false, false],
|
|
65
65
|
itemCategory: pickAWinner(itemCategories, integer(0, 27)),
|
|
66
66
|
dateItemListed: date(30, true, 'YYYY-MM-DD'),
|
|
67
|
-
itemId: integer(1000, 9999),
|
|
68
67
|
}
|
|
69
68
|
},
|
|
70
69
|
{
|
|
71
70
|
event: "page view",
|
|
72
71
|
weight: 10,
|
|
73
72
|
properties: {
|
|
74
|
-
page: ["/", "/", "/help", "/account", "/watch", "/listen", "/product", "/people", "/peace"],
|
|
75
|
-
utm_source: ["$organic", "$organic", "$organic", "$organic", "google", "google", "google", "facebook", "facebook", "twitter", "linkedin"],
|
|
73
|
+
page: pickAWinner(["/", "/", "/help", "/account", "/watch", "/listen", "/product", "/people", "/peace"]),
|
|
74
|
+
utm_source: pickAWinner(["$organic", "$organic", "$organic", "$organic", "google", "google", "google", "facebook", "facebook", "twitter", "linkedin"]),
|
|
76
75
|
}
|
|
77
76
|
},
|
|
78
77
|
{
|
|
@@ -81,7 +80,7 @@ const config = {
|
|
|
81
80
|
properties: {
|
|
82
81
|
videoCategory: pickAWinner(videoCategories, integer(0, 9)),
|
|
83
82
|
isFeaturedItem: [true, false, false],
|
|
84
|
-
watchTimeSec:
|
|
83
|
+
watchTimeSec: weighNumRange(10, 600, .25),
|
|
85
84
|
quality: ["2160p", "1440p", "1080p", "720p", "480p", "360p", "240p"],
|
|
86
85
|
format: ["mp4", "avi", "mov", "mpg"],
|
|
87
86
|
uploader_id: chance.guid.bind(chance)
|
|
@@ -95,7 +94,6 @@ const config = {
|
|
|
95
94
|
isFeaturedItem: [true, false, false],
|
|
96
95
|
itemCategory: pickAWinner(itemCategories, integer(0, 27)),
|
|
97
96
|
dateItemListed: date(30, true, 'YYYY-MM-DD'),
|
|
98
|
-
itemId: integer(1000, 9999),
|
|
99
97
|
}
|
|
100
98
|
},
|
|
101
99
|
{
|
|
@@ -105,7 +103,6 @@ const config = {
|
|
|
105
103
|
isFeaturedItem: [true, false, false],
|
|
106
104
|
itemCategory: pickAWinner(itemCategories, integer(0, 27)),
|
|
107
105
|
dateItemListed: date(30, true, 'YYYY-MM-DD'),
|
|
108
|
-
itemId: integer(1000, 9999),
|
|
109
106
|
}
|
|
110
107
|
},
|
|
111
108
|
{
|
|
@@ -123,9 +120,7 @@ const config = {
|
|
|
123
120
|
],
|
|
124
121
|
superProps: {
|
|
125
122
|
platform: ["web", "mobile", "web", "mobile", "web", "web", "kiosk", "smartTV"],
|
|
126
|
-
currentTheme: ["light", "dark", "custom", "light", "dark"],
|
|
127
|
-
// emotions: generateEmoji(),
|
|
128
|
-
|
|
123
|
+
currentTheme: weighChoices(["light", "dark", "custom", "light", "dark"]),
|
|
129
124
|
},
|
|
130
125
|
/*
|
|
131
126
|
user properties work the same as event properties
|
|
@@ -133,20 +128,11 @@ const config = {
|
|
|
133
128
|
*/
|
|
134
129
|
userProps: {
|
|
135
130
|
title: chance.profession.bind(chance),
|
|
136
|
-
luckyNumber:
|
|
137
|
-
spiritAnimal: ["duck", "dog", "otter", "penguin", "cat", "elephant", "lion", "cheetah", "giraffe", "zebra", "rhino", "hippo", "whale", "dolphin", "shark", "octopus", "squid", "jellyfish", "starfish", "seahorse", "crab", "lobster", "shrimp", "clam", "snail", "slug", "butterfly", "moth", "bee", "wasp", "ant", "beetle", "ladybug", "caterpillar", "centipede", "millipede", "scorpion", "spider", "tarantula", "tick", "mite", "mosquito", "fly", "dragonfly", "damselfly", "grasshopper", "cricket", "locust", "mantis", "cockroach", "termite", "praying mantis", "walking stick", "stick bug", "leaf insect", "lacewing", "aphid", "cicada", "thrips", "psyllid", "scale insect", "whitefly", "mealybug", "planthopper", "leafhopper", "treehopper", "flea", "louse", "bedbug", "flea beetle", "weevil", "longhorn beetle", "leaf beetle", "tiger beetle", "ground beetle", "lady beetle", "firefly", "click beetle", "rove beetle", "scarab beetle", "dung beetle", "stag beetle", "rhinoceros beetle", "hercules beetle", "goliath beetle", "jewel beetle", "tortoise beetle"]
|
|
131
|
+
luckyNumber: weighNumRange(42, 420, .3),
|
|
132
|
+
spiritAnimal: pickAWinner(["duck", "dog", "otter", "penguin", "cat", "elephant", "lion", "cheetah", "giraffe", "zebra", "rhino", "hippo", "whale", "dolphin", "shark", "octopus", "squid", "jellyfish", "starfish", "seahorse", "crab", "lobster", "shrimp", "clam", "snail", "slug", "butterfly", "moth", "bee", "wasp", "ant", "beetle", "ladybug", "caterpillar", "centipede", "millipede", "scorpion", "spider", "tarantula", "tick", "mite", "mosquito", "fly", "dragonfly", "damselfly", "grasshopper", "cricket", "locust", "mantis", "cockroach", "termite", "praying mantis", "walking stick", "stick bug", "leaf insect", "lacewing", "aphid", "cicada", "thrips", "psyllid", "scale insect", "whitefly", "mealybug", "planthopper", "leafhopper", "treehopper", "flea", "louse", "bedbug", "flea beetle", "weevil", "longhorn beetle", "leaf beetle", "tiger beetle", "ground beetle", "lady beetle", "firefly", "click beetle", "rove beetle", "scarab beetle", "dung beetle", "stag beetle", "rhinoceros beetle", "hercules beetle", "goliath beetle", "jewel beetle", "tortoise beetle"])
|
|
138
133
|
},
|
|
139
|
-
|
|
140
134
|
scdProps: {},
|
|
141
|
-
mirrorProps: {
|
|
142
|
-
isBot: { events: "*", values: [false, false, false, false, true] },
|
|
143
|
-
profit: { events: ["checkout"], values: [4, 2, 42, 420] },
|
|
144
|
-
watchTimeSec: {
|
|
145
|
-
events: ["watch video"],
|
|
146
|
-
values: weightedRange(50, 1200, 6)
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
},
|
|
135
|
+
mirrorProps: {},
|
|
150
136
|
|
|
151
137
|
/*
|
|
152
138
|
for group analytics keys, we need an array of arrays [[],[],[]]
|
package/scratch.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import main from "./core/index.js";
|
|
2
|
-
import amir from './
|
|
2
|
+
import amir from './dungeons/amir.js';
|
|
3
3
|
import simple from './schemas/simple.js';
|
|
4
4
|
import funnels from './schemas/funnels.js';
|
|
5
5
|
import foobar from './schemas/foobar.js';
|
|
@@ -7,18 +7,15 @@ import complex from './schemas/complex.js';
|
|
|
7
7
|
import deepNest from './schemas/deepNest.js';
|
|
8
8
|
import anon from './schemas/anon.js';
|
|
9
9
|
import execSync from 'child_process';
|
|
10
|
+
import gio from './dungeons/gio-apt-list.js';
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
/** @type {main.Config} */
|
|
13
14
|
const spec = {
|
|
14
|
-
...
|
|
15
|
+
...gio,
|
|
15
16
|
writeToDisk: false,
|
|
16
17
|
verbose: true,
|
|
17
|
-
makeChart: false,
|
|
18
|
-
numUsers: 100,
|
|
19
|
-
numEvents: 10000,
|
|
20
|
-
numDays: 90,
|
|
21
|
-
token: ""
|
|
18
|
+
makeChart: false,
|
|
22
19
|
};
|
|
23
20
|
|
|
24
21
|
|
package/scripts/new.sh
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Ensure the ./path directory exists
|
|
4
|
+
mkdir -p ./dungeons
|
|
5
|
+
|
|
6
|
+
# Generate a random file name with .js extension
|
|
7
|
+
random_file_name=$(mktemp ./dungeons/my-file-XXXXXXXX.js)
|
|
8
|
+
|
|
9
|
+
# Initial text to write to the file
|
|
10
|
+
initial_text='
|
|
11
|
+
const SEED = "my-seed";
|
|
12
|
+
const dayjs = require("dayjs");
|
|
13
|
+
const utc = require("dayjs/plugin/utc");
|
|
14
|
+
dayjs.extend(utc);
|
|
15
|
+
require("dotenv").config();
|
|
16
|
+
const u = require("../core/utils");
|
|
17
|
+
const v = require("ak-tools");
|
|
18
|
+
const chance = u.initChance(SEED);
|
|
19
|
+
|
|
20
|
+
/** @type {import("../types").Config} */
|
|
21
|
+
const config = {
|
|
22
|
+
token: "",
|
|
23
|
+
seed: SEED,
|
|
24
|
+
numDays: 100, //how many days worth of data
|
|
25
|
+
numEvents: 100000, //how many events
|
|
26
|
+
numUsers: 1000, //how many users
|
|
27
|
+
format: "csv", //csv or json
|
|
28
|
+
region: "US",
|
|
29
|
+
makeChart: false,
|
|
30
|
+
anonIds: false,
|
|
31
|
+
sessionIds: false,
|
|
32
|
+
writeToDisk: false,
|
|
33
|
+
events: [],
|
|
34
|
+
superProps: {},
|
|
35
|
+
userProps: {},
|
|
36
|
+
scdProps: {},
|
|
37
|
+
mirrorProps: {},
|
|
38
|
+
groupKeys: [],
|
|
39
|
+
groupProps: {},
|
|
40
|
+
lookupTables: [],
|
|
41
|
+
hook: function(record, type, meta) {
|
|
42
|
+
return record;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
module.exports = config;'
|
|
47
|
+
|
|
48
|
+
# Write the initial text to the new file
|
|
49
|
+
echo "$initial_text" > "$random_file_name"
|
|
50
|
+
|
|
51
|
+
# Output the name of the created file
|
|
52
|
+
echo "File created: $random_file_name"
|
|
File without changes
|
package/tests/e2e.test.js
CHANGED
|
@@ -10,8 +10,9 @@ const u = require('ak-tools');
|
|
|
10
10
|
|
|
11
11
|
const simple = require('../schemas/simple.js');
|
|
12
12
|
const complex = require('../schemas/complex.js');
|
|
13
|
-
const deep = require('../schemas/deepNest.js');
|
|
14
13
|
const anon = require('../schemas/anon.js');
|
|
14
|
+
const funnels = require('../schemas/funnels.js');
|
|
15
|
+
const foobar = require('../schemas/foobar.js');
|
|
15
16
|
|
|
16
17
|
const timeout = 60000;
|
|
17
18
|
const testToken = process.env.TEST_TOKEN;
|
|
@@ -55,17 +56,6 @@ describe('module', () => {
|
|
|
55
56
|
|
|
56
57
|
}, timeout);
|
|
57
58
|
|
|
58
|
-
test('works as module (deep nest)', async () => {
|
|
59
|
-
console.log('MODULE TEST: DEEP NEST');
|
|
60
|
-
const results = await generate({ ...deep, verbose: true, writeToDisk: false, numEvents: 1100, numUsers: 100, seed: "deal with it" });
|
|
61
|
-
const { eventData, groupProfilesData, lookupTableData, scdTableData, userProfilesData } = results;
|
|
62
|
-
expect(eventData.length).toBeGreaterThan(980);
|
|
63
|
-
expect(groupProfilesData.length).toBe(0);
|
|
64
|
-
expect(lookupTableData.length).toBe(0);
|
|
65
|
-
expect(scdTableData.length).toBe(0);
|
|
66
|
-
expect(userProfilesData.length).toBe(100);
|
|
67
|
-
|
|
68
|
-
}, timeout);
|
|
69
59
|
|
|
70
60
|
test('fails with invalid configuration', async () => {
|
|
71
61
|
try {
|
|
@@ -92,7 +82,7 @@ describe('cli', () => {
|
|
|
92
82
|
const run = execSync(`node ./core/index.js --numEvents 1000 --numUsers 100`, { stdio: 'ignore' });
|
|
93
83
|
// expect(run.toString().trim().includes('have a wonderful day :)')).toBe(true);
|
|
94
84
|
const csvs = (await u.ls('./data')).filter(a => a.includes('.csv'));
|
|
95
|
-
expect(csvs.length).toBe(
|
|
85
|
+
expect(csvs.length).toBe(2);
|
|
96
86
|
clearData();
|
|
97
87
|
}, timeout);
|
|
98
88
|
|
|
@@ -110,18 +100,10 @@ describe('cli', () => {
|
|
|
110
100
|
const run = execSync(`node ./core/index.js --numEvents 1000 --numUsers 100 --seed "deal with it" --simple`);
|
|
111
101
|
expect(run.toString().trim().includes('have a wonderful day :)')).toBe(true);
|
|
112
102
|
const csvs = (await u.ls('./data')).filter(a => a.includes('.csv'));
|
|
113
|
-
expect(csvs.length).toBe(
|
|
103
|
+
expect(csvs.length).toBe(2);
|
|
114
104
|
clearData();
|
|
115
105
|
}, timeout);
|
|
116
106
|
|
|
117
|
-
test('works as CLI (custom)', async () => {
|
|
118
|
-
console.log('custom CLI TEST');
|
|
119
|
-
const run = execSync(`node ./core/index.js ./schemas/deepNest.js`);
|
|
120
|
-
expect(run.toString().trim().includes('have a wonderful day :)')).toBe(true);
|
|
121
|
-
const csvs = (await u.ls('./data')).filter(a => a.includes('.csv'));
|
|
122
|
-
expect(csvs.length).toBe(3);
|
|
123
|
-
clearData();
|
|
124
|
-
}, timeout);
|
|
125
107
|
|
|
126
108
|
});
|
|
127
109
|
|