ttmg-pack 0.4.4 → 0.4.6

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.
Files changed (45) hide show
  1. package/CHANGELOG.md +403 -0
  2. package/__TEST__/tests/fixtures/check-project/non-unity/src/game.js +1 -0
  3. package/__TEST__/tests/fixtures/check-project/non-unity/src/game.json +3 -0
  4. package/__TEST__/tests/fixtures/check-project/subpackages-camel-case/src/game.js +1 -0
  5. package/__TEST__/tests/fixtures/check-project/subpackages-camel-case/src/game.json +4 -0
  6. package/__TEST__/tests/fixtures/check-project/unity-large-config-disabled/src/game.js +1 -0
  7. package/__TEST__/tests/fixtures/check-project/unity-large-config-disabled/src/game.json +4 -0
  8. package/__TEST__/tests/fixtures/check-project/unity-large-config-disabled/src/webgl-wasm-split.json +3 -0
  9. package/__TEST__/tests/fixtures/check-project/unity-large-config-enabled/src/game.js +1 -0
  10. package/__TEST__/tests/fixtures/check-project/unity-large-config-enabled/src/game.json +4 -0
  11. package/__TEST__/tests/fixtures/check-project/unity-large-config-enabled/src/webgl-wasm-split.json +3 -0
  12. package/__TEST__/tests/fixtures/check-project/unity-large-no-config/src/game.js +1 -0
  13. package/__TEST__/tests/fixtures/check-project/unity-large-no-config/src/game.json +4 -0
  14. package/__TEST__/tests/fixtures/check-project/unity-small/src/game.js +1 -0
  15. package/__TEST__/tests/fixtures/check-project/unity-small/src/game.json +4 -0
  16. package/__TEST__/tests/fixtures/game-cocos/game.json +3 -0
  17. package/__TEST__/tests/fixtures/game-invalid-json/game.json +1 -0
  18. package/__TEST__/tests/fixtures/game-no-config/game.js +1 -0
  19. package/__TEST__/tests/fixtures/game-no-engine/game.json +3 -0
  20. package/__TEST__/tests/fixtures/game-unity/game.json +15 -0
  21. package/__TEST__/tests/libs/checkProject.test.js +68 -0
  22. package/__TEST__/tests/runner-simple.js +120 -0
  23. package/__TEST__/tests/runner.js +102 -0
  24. package/__TEST__/tests/utils/Deferred.test.js +69 -0
  25. package/__TEST__/tests/utils/asyncPool.test.js +48 -0
  26. package/__TEST__/tests/utils/getCheckConfig.test.js +24 -0
  27. package/__TEST__/tests/utils/getGameEngine.test.js +32 -0
  28. package/__TEST__/tests/utils/getIndependentPackagesConfig.test.js +27 -0
  29. package/__TEST__/tests/utils/getMd5.test.js +31 -0
  30. package/__TEST__/tests/utils/getSubpackagesConfig.test.js +26 -0
  31. package/__TEST__/tests/utils/unity.test.js +30 -0
  32. package/dist/index.js +19 -11
  33. package/dist/index.js.map +1 -1
  34. package/dist/libs/checkPkgs/checkPkgPath.d.ts +1 -0
  35. package/dist/libs/extractPkgs/hasAnyNodeModulesShallow.d.ts +1 -0
  36. package/dist/libs/extractPkgs/index.d.ts +6 -0
  37. package/dist/libs/makePkgs/extract/NodeModuleExtractor.d.ts +39 -0
  38. package/dist/libs/makePkgs/extract/hasAnyNodeModulesShallow.d.ts +1 -0
  39. package/dist/libs/makePkgs/extract/index.d.ts +6 -0
  40. package/dist/libs/makePkgs/extract.d.ts +4 -0
  41. package/dist/typings/index.d.ts +14 -0
  42. package/dist/utils/NodeModuleExtractor.d.ts +38 -0
  43. package/dist/utils/i18n.d.ts +2 -0
  44. package/dist/utils/overrideConfig.d.ts +8 -0
  45. package/package.json +1 -1
package/CHANGELOG.md ADDED
@@ -0,0 +1,403 @@
1
+ ## 0.0.1
2
+
3
+ 发布第一个版本,将分包逻辑单独维护
4
+
5
+ ## 0.0.3
6
+
7
+ - 增加类型导出
8
+ - 修改入参格式
9
+
10
+ ## 0.0.4
11
+
12
+ - 支持自定义输出 log
13
+ - 打包产物支持 banner 注释
14
+
15
+ ## 0.0.5
16
+
17
+ - 调整包大小校验限制,主包 30MB,子包 4MB
18
+
19
+ ## 0.0.6
20
+
21
+ 优化入口接口
22
+
23
+ ```
24
+ export interface BuildConfig {
25
+ entry: string;
26
+ output: string;
27
+ rules?: {
28
+ mainPackageSizeLimit: number;
29
+ projectSizeLimit: number;
30
+ subpackageSizeLimit?: number;
31
+ };
32
+ enableDev?: boolean;
33
+ enableCheck?: boolean;
34
+ enableLog?: boolean;
35
+ }
36
+
37
+ ```
38
+
39
+ ## 0.0.7
40
+
41
+ 支持类型文件导出
42
+
43
+ ## 0.0.8
44
+
45
+ ODR 相关功能
46
+
47
+ - 支持 ODR 打包
48
+ - 支持 ODR 下载
49
+ - 支持 ODR 配置写入
50
+
51
+ ## 0.0.9
52
+
53
+ 拆分 debug 功能 和 build 功能
54
+
55
+ ## 0.0.10
56
+
57
+ fix buildPkgs 日志输出问题
58
+
59
+ ## 0.0.11
60
+
61
+ 移除 console.log 日志
62
+
63
+ ## 0.0.12
64
+
65
+ 支持校验 project.config.json,appid 不能为空,开发调试环节强依赖
66
+
67
+ ## 0.0.13
68
+
69
+ 移除无效 log
70
+
71
+ ## 0.0.14
72
+
73
+ 导出 packageConfig.json,调试环节使用
74
+
75
+ ## 0.0.15
76
+
77
+ fix: 修复 生成 projectConfig.json
78
+
79
+ ## 0.0.16
80
+
81
+ 调试模式不做大小校验,只做警告
82
+
83
+ ## 0.0.17
84
+
85
+ 支持 sourcemap
86
+
87
+ ## 0.0.18
88
+
89
+ 支持 sourcemap 配置
90
+
91
+ ## 0.0.19
92
+
93
+ 支持自定义 sourcemap 文件名
94
+
95
+ ## 0.0.20
96
+
97
+ 1. 支持多种 sourcemap 输出方案
98
+ 2. 优化打包配置接口
99
+
100
+ ## 0.0.21
101
+
102
+ 1. 优化生产 sourcemap 生成逻辑
103
+
104
+ ## 0.0.22
105
+
106
+ 修复 sourcemap
107
+
108
+ ## 0.0.23
109
+
110
+ 优化 pack 逻辑,降低耗时
111
+
112
+ ## 0.0.24
113
+
114
+ 优化 buildPkgs 逻辑
115
+
116
+ ## 0.0.25
117
+
118
+ fix: odr 下载逻辑,Array buffer 读写
119
+
120
+ ## 0.0.26
121
+
122
+ 1. fix: source map 写入 bug
123
+ 2. 支持 esmodule 打包
124
+
125
+ ## 0.0.27
126
+
127
+ 1. 修复循环依赖问题
128
+
129
+ ## 0.0.28
130
+
131
+ 回滚 支持 esmodule 打包,止损加密后解密失败的问题
132
+
133
+ ## 0.0.29
134
+
135
+ 支持 es module 打包
136
+
137
+ ## 0.0.30
138
+
139
+ 修改类型定义文件
140
+
141
+ ## 0.0.31
142
+
143
+ 1. 修复 打包逻辑,移除 subpackages 逻辑,基于 root 进行分包拆解
144
+ 2. 修复 debugPkgs 逻辑,合并代码出问题,导致 wasmcode 代码丢失
145
+
146
+ ## 0.0.32
147
+
148
+ 1. 移除日志
149
+ 2. 移除 subpackages 常量
150
+
151
+ ## 0.0.33
152
+
153
+ 修复打包 BUG
154
+
155
+ ## 0.0.34
156
+
157
+ 1. pack remove file not work
158
+ 2. merge remove file not work
159
+
160
+ ## 0.0.35
161
+
162
+ fix main path error
163
+
164
+ ## 0.0.36
165
+
166
+ remove useless log
167
+
168
+ ## 0.0.37
169
+
170
+ 支持调试模式校验日志导出
171
+
172
+ ## 0.0.38
173
+
174
+ 导出 checkPkgs 函数
175
+
176
+ ## 0.0.39
177
+
178
+ 1. 导出 getPkgs 函数
179
+ 2. 修复校验主包大小 BUG
180
+
181
+ ## 0.0.40
182
+
183
+ 1. 导出 GAME_MAIN_PACKAGE_NAME 常量
184
+ 2. 修复校验主包大小 BUG
185
+
186
+ ## 0.0.41/42
187
+
188
+ 优化校验逻辑提示文案
189
+
190
+ ## 0.0.43
191
+
192
+ 调整 log 结构
193
+
194
+ ## 0.0.44
195
+
196
+ 移除日志空格
197
+
198
+ ## 0.0.45
199
+
200
+ 优化打包类型
201
+
202
+ ## 0.0.46
203
+
204
+ 包大小限制提示大小显示问题优化,避免 0MB 展示效果
205
+
206
+ ## 0.0.47
207
+
208
+ 修复校验主包大小 BUG
209
+
210
+ ## 0.0.48
211
+
212
+ 优化校验逻辑提示文案
213
+
214
+ ## 0.0.49
215
+
216
+ 优化校验逻辑提示文案
217
+
218
+ ## 0.0.50
219
+
220
+ 优化校验逻辑提示文案,移除废弃 log
221
+
222
+ ## 0.0.51
223
+
224
+ 支持 fyf packages 导出
225
+
226
+ ## 0.0.52
227
+
228
+ 支持必接 API 预检查,校验必接 API 是否被调用,但是否生效不在检查范畴内
229
+
230
+ ## 0.0.53
231
+
232
+ 移除非必要日志
233
+
234
+ ## 0.0.54
235
+
236
+ 修复 require 路径解析问题
237
+
238
+ ## 0.0.55
239
+
240
+ 支持 unity 游戏引擎,对于 unity 游戏引擎的游戏,不限制主包和独立分包大小
241
+
242
+ ## 0.0.56
243
+
244
+ 补充必接 API 校验范围
245
+
246
+ ## 0.1.0
247
+
248
+ 发布 0.1.0 版本,更新后续平台升级
249
+
250
+ ## 0.1.1
251
+
252
+ 移除 project.config.json 校验
253
+
254
+ ## 0.1.2-0.1.5
255
+
256
+ 开发 unity 相关
257
+
258
+ ## 0.1.2
259
+
260
+ 支持 getPkgs unity br 信息导出
261
+
262
+ ## 0.1.3
263
+
264
+ 优化 unity br 相关问题,支持 CLI 部分测试
265
+
266
+ ## 0.1.4
267
+
268
+ 修复 unity br 相关问题,支持 CLI 全部测试,补发版本
269
+
270
+ ## 0.1.5
271
+
272
+ 调整 unity 包大小问题校验,仅对非 unity 工程生效
273
+
274
+ ## 0.1.6
275
+
276
+ 修复 esbuild 构建编码问题,导致部分 JS 语法不符合预期
277
+
278
+ ## 0.1.7
279
+
280
+ 调整 esbuild 构建目标为 esnext,避免部分语法不符合预期
281
+
282
+ ## 0.1.8
283
+
284
+ 调整 esbuild 构建目标为 es2015,避免部分语法不符合预期
285
+
286
+ ## 0.1.8-beta.1
287
+
288
+ 导出 unity 相关函数
289
+
290
+ ## 0.1.9
291
+
292
+ 支持开放数据域
293
+
294
+ ## 0.2.0
295
+
296
+ fix: 修复 esbuild 构建编码问题
297
+
298
+ ## 0.2.0-beta.1
299
+
300
+ 切换成 esbuild 更稳定的 build
301
+
302
+ ## 0.2.1
303
+
304
+ 完善编译, 修复 open data context 编译问题
305
+
306
+ ## 0.2.2
307
+
308
+ 补充对 分包名称名称为中文类型字符的校验支持,避免打包失败
309
+
310
+ ## 0.2.3
311
+
312
+ esbuild 构建目标调整为 es2020,避免部分语法不符合预期,和安卓 vmsdk 支持最低版本保持一致
313
+
314
+ ## 0.2.4
315
+
316
+ 修复 open data context 编译问题
317
+
318
+ ## 0.2.5
319
+
320
+ 修复 open data context 编译问题
321
+
322
+ ## 0.2.6
323
+
324
+ 修复 build 失败丢失 open data context 代码问题
325
+
326
+ ## 0.2.7
327
+
328
+ 修复 open data context 代码丢失问题,彻底修复
329
+ 调整 esbuild 构建目标为 esnext,避免部分语法不符合预期
330
+
331
+ ## 0.2.8
332
+
333
+ 支持 unity 游戏引擎,支持包体个性化校验 60MB
334
+
335
+ ## 0.2.9
336
+ 本地调试代码预检查校验适配 unity 包大小限制
337
+
338
+ ## 0.3.0
339
+ 空发了
340
+
341
+ ## 0.3.1
342
+
343
+ 修复 open data context 代码丢失问题,兼容 Cocos 2.0 版本
344
+
345
+ ## 0.3.2-0.3.5
346
+ for unity plugin
347
+
348
+ ## 0.3.6
349
+
350
+ 1. **参数简化**:将多个函数的入参从多个参数改为单个 `config` 参数
351
+ - `checkProjectSize`
352
+ - `checkIndependentPackages`
353
+ - `checkSubpackages`
354
+ - `makePkgs`
355
+
356
+ 2. **错误处理**:修复 `checkMainPackageEntry` 在非开发环境下不抛异常的问题
357
+
358
+ 3. **修复 bug**:修复 `subPackages` 小驼峰配置导致主包大小计算错误的问题,现在会给出正确的错误提示
359
+
360
+ ## 0.3.7
361
+
362
+ 1. **优化错误处理**:将 `subPackages` 小驼峰配置的错误处理从抛出异常改为返回 error 级别的检查结果,避免 CLI 项目直接崩溃
363
+
364
+ 2. **增强兼容性**:修改 `getSubpackagesRoots` 函数,优先使用小写的 `subpackages`,如果没有,再使用小驼峰的 `subPackages`,确保主包大小的校验不会出问题
365
+
366
+ ## 0.3.8
367
+
368
+ 1. **优化错误信息**:移除了所有 console 打印语句,不再向开发者打印 console 信息,统一通过返回的检查结果进行错误处理
369
+
370
+ 2. **修复重复错误信息**:移除了 `checkSubpackages` 函数中对 `subPackages` 小驼峰配置的重复检查,确保错误信息只显示一次
371
+
372
+ ## 0.3.9
373
+
374
+ 1. 增加对 wasmFuncCount 校验
375
+
376
+ ## 0.3.10
377
+ 1. 优化 wasmFuncCount 校验逻辑提示文案
378
+
379
+ ## 0.4.0
380
+
381
+ 1. **优化 wasmFuncCount 校验逻辑**:当 game.json 中没有 wasmFuncCount 字段时直接返回 null,不进行校验,保证老用户不被干扰
382
+ 2. **完善边界条件处理**:wasmFuncCount 为 0 时仍会进行正常校验
383
+
384
+ ## 0.4.1-0.4.2
385
+
386
+ 1. **所有 CheckResult 新增 `required` 字段**:用于区分校验项是否为必须通过项
387
+ - API 校验(`checkAPI`):`required: false`,表示为建议性校验
388
+ - 其他校验(config / size / performance):`required: true`,表示为强制性校验
389
+ 2. **类型定义更新**:`CheckSizeResult`、`CheckConfigResult`、`CheckPerfResult` 接口均新增 `required: boolean` 字段
390
+
391
+ ## 0.4.3
392
+ 1. 支持日志多语言
393
+
394
+ ## 0.4.4
395
+
396
+ 1. 修复线上因网络环境,请求插件信息失败的问题
397
+
398
+ ## 0.4.5
399
+
400
+ 1. 修复安卓调试模式下 dependencies 下载包失败的问题
401
+
402
+ ## 0.4.6
403
+ 优化 wasmcode 分包提示问题
@@ -0,0 +1 @@
1
+ console.log('test');
@@ -0,0 +1,3 @@
1
+ {
2
+ "gameEngine": "cocos"
3
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "gameEngine": "cocos",
3
+ "subPackages": []
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "gameEngine": "unity",
3
+ "wasmFuncCount": 80000
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "gameEngine": "unity",
3
+ "wasmFuncCount": 80000
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "gameEngine": "unity",
3
+ "wasmFuncCount": 80000
4
+ }
@@ -0,0 +1 @@
1
+ console.log('test');
@@ -0,0 +1,4 @@
1
+ {
2
+ "gameEngine": "unity",
3
+ "wasmFuncCount": 79999
4
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "gameEngine": "cocos"
3
+ }
@@ -0,0 +1 @@
1
+ { invalid json }
@@ -0,0 +1 @@
1
+ console.log('test');
@@ -0,0 +1,3 @@
1
+ {
2
+ "name": "test game"
3
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "gameEngine": "unity",
3
+ "wasmFuncCount": 79999,
4
+ "subpackages": [
5
+ {
6
+ "name": "sub1",
7
+ "root": "subpackages/sub1"
8
+ },
9
+ {
10
+ "name": "sub2",
11
+ "root": "subpackages/sub2",
12
+ "independent": true
13
+ }
14
+ ]
15
+ }
@@ -0,0 +1,68 @@
1
+ const assert = require('assert');
2
+ const path = require('path');
3
+ const { checkGameJson, checkProjectSize } = require('../../../dist/libs/checkPkgs/checkProject');
4
+ const { createPackTranslator } = require('../../../dist/utils');
5
+
6
+ const t = createPackTranslator('en-US');
7
+ const fixturesPath = path.join(__dirname, '../fixtures/check-project');
8
+
9
+ describe('checkProject', function() {
10
+ describe('checkGameJson', function() {
11
+ it('should check game.json exists and passes', function() {
12
+ const result = checkGameJson({
13
+ entry: path.join(fixturesPath, 'non-unity/src'),
14
+ dev: { enable: true }
15
+ }, t);
16
+ assert.strictEqual(result.passed, true);
17
+ });
18
+
19
+ it('should return error when game.json is missing (dev mode)', function() {
20
+ const result = checkGameJson({
21
+ entry: path.join(fixturesPath, 'game-json-missing/src'),
22
+ dev: { enable: true }
23
+ }, t);
24
+ assert.strictEqual(result.passed, false);
25
+ assert.strictEqual(result.level, 'error');
26
+ });
27
+
28
+ it('should throw error when game.json is missing (non-dev mode)', function() {
29
+ assert.throws(() => {
30
+ checkGameJson({
31
+ entry: path.join(fixturesPath, 'game-json-missing/src'),
32
+ dev: { enable: false }
33
+ }, t);
34
+ }, /Cannot find game\.json/);
35
+ });
36
+
37
+ it('should check for subPackages (camelCase) and return error (dev mode)', function() {
38
+ const result = checkGameJson({
39
+ entry: path.join(fixturesPath, 'subpackages-camel-case/src'),
40
+ dev: { enable: true }
41
+ }, t);
42
+ assert.strictEqual(result.passed, false);
43
+ assert.strictEqual(result.level, 'error');
44
+ });
45
+
46
+ it('should check for subPackages (camelCase) and throw error (non-dev mode)', function() {
47
+ assert.throws(() => {
48
+ checkGameJson({
49
+ entry: path.join(fixturesPath, 'subpackages-camel-case/src'),
50
+ dev: { enable: false }
51
+ }, t);
52
+ }, /subPackages/);
53
+ });
54
+ });
55
+
56
+ describe('checkProjectSize', function() {
57
+ it('should check project size and pass within limit', function() {
58
+ const result = checkProjectSize({
59
+ entry: path.join(fixturesPath, 'non-unity/src'),
60
+ dev: { enable: true },
61
+ build: {
62
+ pkgSizeLimit: 100 * 1024 * 1024
63
+ }
64
+ }, t);
65
+ assert.strictEqual(result.passed, true);
66
+ });
67
+ });
68
+ });
@@ -0,0 +1,120 @@
1
+ const assert = require('assert');
2
+ const path = require('path');
3
+ const fs = require('fs');
4
+ const { checkPkgs } = require('../../dist/index');
5
+
6
+ const tests = [];
7
+ const describeStack = [];
8
+ let currentDescribe = null;
9
+
10
+ function describe(name, fn) {
11
+ const suite = { name, tests: [], children: [] };
12
+ if (currentDescribe) {
13
+ currentDescribe.children.push(suite);
14
+ } else {
15
+ tests.push(suite);
16
+ }
17
+ describeStack.push(currentDescribe);
18
+ currentDescribe = suite;
19
+ try {
20
+ fn();
21
+ } finally {
22
+ currentDescribe = describeStack.pop();
23
+ }
24
+ }
25
+
26
+ function it(name, fn) {
27
+ if (!currentDescribe) {
28
+ throw new Error('it() must be called inside describe()');
29
+ }
30
+ currentDescribe.tests.push({ name, fn });
31
+ }
32
+
33
+ let passed = 0;
34
+ let failed = 0;
35
+
36
+ async function runSuite(suite, indent = 0) {
37
+ console.log(`${' '.repeat(indent)}${suite.name}`);
38
+ for (const test of suite.tests) {
39
+ try {
40
+ if (test.fn.constructor.name === 'AsyncFunction') {
41
+ await test.fn();
42
+ } else {
43
+ test.fn();
44
+ }
45
+ console.log(`${' '.repeat(indent + 1)}✓ ${test.name}`);
46
+ passed++;
47
+ } catch (error) {
48
+ console.log(`${' '.repeat(indent + 1)}✗ ${test.name}`);
49
+ console.log(`${' '.repeat(indent + 2)}${error.message}`);
50
+ if (error.stack) {
51
+ console.log(`${' '.repeat(indent + 2)}${error.stack.split('\n').slice(1).join('\n' + ' '.repeat(indent + 2))}`);
52
+ }
53
+ failed++;
54
+ }
55
+ }
56
+ for (const child of suite.children) {
57
+ await runSuite(child, indent + 1);
58
+ }
59
+ }
60
+
61
+ describe('checkPkgs Integration Tests', function() {
62
+ it('should run checkPkgs on unity-small test case', async function() {
63
+ const result = await checkPkgs({
64
+ entry: path.join(__dirname, '../wasm-test/unity-small/src'),
65
+ output: path.join(__dirname, '../output'),
66
+ dev: {
67
+ enable: true,
68
+ enableLog: false
69
+ },
70
+ build: {
71
+ enableOdr: false,
72
+ pkgSizeLimit: 30 * 1024 * 1024,
73
+ mainPkgSizeLimit: 1 * 1024 * 1024,
74
+ independentSubPkgSizeLimit: 4 * 1024 * 1024
75
+ }
76
+ });
77
+ assert(Array.isArray(result));
78
+ });
79
+
80
+ it('should run checkPkgs on unity-large-config-enabled test case', async function() {
81
+ const result = await checkPkgs({
82
+ entry: path.join(__dirname, '../wasm-test/unity-large-config-enabled/src'),
83
+ output: path.join(__dirname, '../output'),
84
+ dev: {
85
+ enable: true,
86
+ enableLog: false
87
+ },
88
+ build: {
89
+ enableOdr: false,
90
+ pkgSizeLimit: 30 * 1024 * 1024,
91
+ mainPkgSizeLimit: 1 * 1024 * 1024,
92
+ independentSubPkgSizeLimit: 4 * 1024 * 1024
93
+ }
94
+ });
95
+ assert(Array.isArray(result));
96
+ });
97
+ });
98
+
99
+ async function runTests() {
100
+ console.log('========================================');
101
+ console.log('Running unit tests');
102
+ console.log('========================================\n');
103
+
104
+ for (const suite of tests) {
105
+ await runSuite(suite);
106
+ }
107
+
108
+ console.log('\n========================================');
109
+ console.log('Test Summary:');
110
+ console.log(` Passed: ${passed}`);
111
+ console.log(` Failed: ${failed}`);
112
+ console.log('========================================');
113
+
114
+ process.exit(failed > 0 ? 1 : 0);
115
+ }
116
+
117
+ global.describe = describe;
118
+ global.it = it;
119
+
120
+ runTests();