@strapi/strapi 4.10.0-beta.1 → 4.10.1-experimental.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/bin/strapi.js +2 -468
- package/coverage/clover.xml +1613 -0
- package/coverage/coverage-final.json +48 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/commands/__tests__/data-transfer/shared/index.html +116 -0
- package/coverage/lcov-report/commands/__tests__/data-transfer/shared/transfer.test.utils.js.html +133 -0
- package/coverage/lcov-report/commands/admin-create.js.html +424 -0
- package/coverage/lcov-report/commands/admin-reset.js.html +241 -0
- package/coverage/lcov-report/commands/generate-template.js.html +373 -0
- package/coverage/lcov-report/commands/index.html +146 -0
- package/coverage/lcov-report/commands/transfer/export.js.html +619 -0
- package/coverage/lcov-report/commands/transfer/import.js.html +562 -0
- package/coverage/lcov-report/commands/transfer/index.html +146 -0
- package/coverage/lcov-report/commands/transfer/transfer.js.html +532 -0
- package/coverage/lcov-report/commands/utils/helpers.js.html +430 -0
- package/coverage/lcov-report/commands/utils/index.html +116 -0
- package/coverage/lcov-report/core/registries/custom-fields.js.html +301 -0
- package/coverage/lcov-report/core/registries/index.html +116 -0
- package/coverage/lcov-report/core-api/controller/collection-type.js.html +418 -0
- package/coverage/lcov-report/core-api/controller/index.html +161 -0
- package/coverage/lcov-report/core-api/controller/index.js.html +220 -0
- package/coverage/lcov-report/core-api/controller/single-type.js.html +274 -0
- package/coverage/lcov-report/core-api/controller/transform.js.html +376 -0
- package/coverage/lcov-report/core-api/service/collection-type.js.html +325 -0
- package/coverage/lcov-report/core-api/service/index.html +161 -0
- package/coverage/lcov-report/core-api/service/index.js.html +220 -0
- package/coverage/lcov-report/core-api/service/pagination.js.html +460 -0
- package/coverage/lcov-report/core-api/service/single-type.js.html +301 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +386 -0
- package/coverage/lcov-report/load/filepath-to-prop-path.js.html +151 -0
- package/coverage/lcov-report/load/index.html +116 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/services/content-api/index.html +116 -0
- package/coverage/lcov-report/services/content-api/index.js.html +307 -0
- package/coverage/lcov-report/services/content-api/permissions/engine.js.html +100 -0
- package/coverage/lcov-report/services/content-api/permissions/index.html +131 -0
- package/coverage/lcov-report/services/content-api/permissions/index.js.html +529 -0
- package/coverage/lcov-report/services/content-api/permissions/providers/action.js.html +142 -0
- package/coverage/lcov-report/services/content-api/permissions/providers/condition.js.html +142 -0
- package/coverage/lcov-report/services/content-api/permissions/providers/index.html +146 -0
- package/coverage/lcov-report/services/content-api/permissions/providers/index.js.html +112 -0
- package/coverage/lcov-report/services/core-store.js.html +520 -0
- package/coverage/lcov-report/services/entity-service/attributes/index.html +131 -0
- package/coverage/lcov-report/services/entity-service/attributes/index.js.html +178 -0
- package/coverage/lcov-report/services/entity-service/attributes/transforms.js.html +145 -0
- package/coverage/lcov-report/services/entity-service/components.js.html +1246 -0
- package/coverage/lcov-report/services/entity-service/index.html +146 -0
- package/coverage/lcov-report/services/entity-service/index.js.html +1120 -0
- package/coverage/lcov-report/services/entity-service/params.js.html +112 -0
- package/coverage/lcov-report/services/entity-validator/__tests__/relations/utils/index.html +116 -0
- package/coverage/lcov-report/services/entity-validator/__tests__/relations/utils/relations.testdata.js.html +544 -0
- package/coverage/lcov-report/services/entity-validator/index.html +131 -0
- package/coverage/lcov-report/services/entity-validator/index.js.html +1231 -0
- package/coverage/lcov-report/services/entity-validator/validators.js.html +733 -0
- package/coverage/lcov-report/services/event-hub.js.html +319 -0
- package/coverage/lcov-report/services/fs.js.html +259 -0
- package/coverage/lcov-report/services/index.html +161 -0
- package/coverage/lcov-report/services/metrics/admin-user-hash.js.html +148 -0
- package/coverage/lcov-report/services/metrics/index.html +206 -0
- package/coverage/lcov-report/services/metrics/index.js.html +265 -0
- package/coverage/lcov-report/services/metrics/is-truthy.js.html +112 -0
- package/coverage/lcov-report/services/metrics/middleware.js.html +184 -0
- package/coverage/lcov-report/services/metrics/rate-limiter.js.html +166 -0
- package/coverage/lcov-report/services/metrics/sender.js.html +394 -0
- package/coverage/lcov-report/services/metrics/stringify-deep.js.html +151 -0
- package/coverage/lcov-report/services/utils/index.html +116 -0
- package/coverage/lcov-report/services/utils/upload-files.js.html +322 -0
- package/coverage/lcov-report/services/worker-queue.js.html +262 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +196 -0
- package/coverage/lcov-report/utils/convert-custom-field-type.js.html +151 -0
- package/coverage/lcov-report/utils/index.html +146 -0
- package/coverage/lcov-report/utils/machine-id.js.html +127 -0
- package/coverage/lcov-report/utils/url-from-segments.js.html +121 -0
- package/ee/LICENSE.txt +21 -0
- package/ee/index.js +3 -1
- package/ee/license.js +8 -7
- package/lib/Strapi.js +3 -0
- package/lib/commands/__tests__/commands.test.js +20 -0
- package/lib/commands/__tests__/commands.test.utils.js +16 -0
- package/lib/commands/actions/admin/create-user/__tests__/admin.create-user.test.js +450 -0
- package/lib/commands/{admin-create.js → actions/admin/create-user/action.js} +2 -2
- package/lib/commands/actions/admin/create-user/command.js +19 -0
- package/lib/commands/actions/admin/reset-user-password/__tests__/admin.reset-user-password.test.js +145 -0
- package/lib/commands/{admin-reset.js → actions/admin/reset-user-password/action.js} +2 -2
- package/lib/commands/actions/admin/reset-user-password/command.js +17 -0
- package/lib/commands/{build.js → actions/build/action.js} +2 -2
- package/lib/commands/actions/build/command.js +15 -0
- package/lib/commands/{configurationDump.js → actions/configuration/dump/action.js} +1 -1
- package/lib/commands/actions/configuration/dump/command.js +17 -0
- package/lib/commands/{configurationRestore.js → actions/configuration/restore/action.js} +1 -1
- package/lib/commands/actions/configuration/restore/command.js +17 -0
- package/lib/commands/{console.js → actions/console/action.js} +2 -2
- package/lib/commands/actions/console/command.js +14 -0
- package/lib/commands/{content-types/list.js → actions/content-types/list/action.js} +2 -2
- package/lib/commands/actions/content-types/list/command.js +14 -0
- package/lib/commands/{controllers/list.js → actions/controllers/list/action.js} +2 -2
- package/lib/commands/actions/controllers/list/command.js +14 -0
- package/lib/commands/{develop.js → actions/develop/action.js} +3 -3
- package/lib/commands/actions/develop/command.js +19 -0
- package/lib/commands/actions/export/__tests__/export.test.js +175 -0
- package/lib/commands/{transfer/export.js → actions/export/action.js} +3 -2
- package/lib/commands/actions/export/command.js +45 -0
- package/lib/commands/actions/generate/command.js +18 -0
- package/lib/commands/{hooks/list.js → actions/hooks/list/action.js} +2 -2
- package/lib/commands/actions/hooks/list/command.js +14 -0
- package/lib/commands/actions/import/__tests__/import.test.js +143 -0
- package/lib/commands/{transfer/import.js → actions/import/action.js} +2 -2
- package/lib/commands/actions/import/command.js +97 -0
- package/lib/commands/{install.js → actions/install/action.js} +1 -1
- package/lib/commands/actions/install/command.js +14 -0
- package/lib/commands/{middlewares/list.js → actions/middlewares/list/action.js} +2 -2
- package/lib/commands/actions/middlewares/list/command.js +14 -0
- package/lib/commands/{new.js → actions/new/action.js} +1 -1
- package/lib/commands/actions/new/command.js +35 -0
- package/lib/commands/{policies/list.js → actions/policies/list/action.js} +2 -2
- package/lib/commands/actions/policies/list/command.js +14 -0
- package/lib/commands/{report.js → actions/report/action.js} +1 -1
- package/lib/commands/actions/report/command.js +17 -0
- package/lib/commands/{routes/list.js → actions/routes/list/action.js} +2 -2
- package/lib/commands/actions/routes/list/command.js +14 -0
- package/lib/commands/{services/list.js → actions/services/list/action.js} +2 -2
- package/lib/commands/actions/services/list/command.js +14 -0
- package/lib/commands/{start.js → actions/start/action.js} +1 -1
- package/lib/commands/actions/start/command.js +14 -0
- package/lib/commands/{opt-out-telemetry.js → actions/telemetry/disable/action.js} +1 -1
- package/lib/commands/actions/telemetry/disable/command.js +14 -0
- package/lib/commands/{opt-in-telemetry.js → actions/telemetry/enable/action.js} +1 -1
- package/lib/commands/actions/telemetry/enable/command.js +14 -0
- package/lib/commands/actions/templates/generate/__tests__/templates.generate.js +118 -0
- package/lib/commands/actions/templates/generate/command.js +14 -0
- package/lib/commands/actions/transfer/__tests__/transfer.test.js +178 -0
- package/lib/commands/{transfer/transfer.js → actions/transfer/action.js} +2 -2
- package/lib/commands/actions/transfer/command.js +115 -0
- package/lib/commands/{ts/generate-types.js → actions/ts/generate-types/action.js} +2 -2
- package/lib/commands/actions/ts/generate-types/command.js +21 -0
- package/lib/commands/{uninstall.js → actions/uninstall/action.js} +1 -1
- package/lib/commands/actions/uninstall/command.js +15 -0
- package/lib/commands/actions/version/command.js +19 -0
- package/lib/commands/{watchAdmin.js → actions/watch-admin/action.js} +4 -4
- package/lib/commands/actions/watch-admin/command.js +15 -0
- package/lib/commands/index.js +66 -0
- package/lib/commands/{transfer/utils.js → utils/data-transfer.js} +2 -2
- package/lib/commands/utils/helpers.js +54 -3
- package/lib/core/registries/__tests__/custom-fields.test.js +152 -0
- package/lib/core/registries/custom-fields.js +19 -2
- package/lib/core-api/__tests__/controller.test.js +39 -0
- package/lib/core-api/controller/__tests__/transform.test.js +226 -0
- package/lib/core-api/service/__tests__/index.test.js +127 -0
- package/lib/core-api/service/__tests__/pagination.test.js +275 -0
- package/lib/load/__tests__/filepath-to-prop-path.test.js +30 -0
- package/lib/middlewares/__tests__/errors.test.js +21 -0
- package/lib/services/__tests__/content-api-permissions.test.js +291 -0
- package/lib/services/__tests__/core-store.test.js +148 -0
- package/lib/services/__tests__/event-hub.test.js +126 -0
- package/lib/services/__tests__/fs.test.js +78 -0
- package/lib/services/__tests__/worker-queue.test.js +47 -0
- package/lib/services/entity-service/__tests__/entity-service-events.test.js +117 -0
- package/lib/services/entity-service/__tests__/entity-service.test.js +587 -0
- package/lib/services/entity-validator/__tests__/biginteger-validators.test.js +220 -0
- package/lib/services/entity-validator/__tests__/date-validators.test.js +183 -0
- package/lib/services/entity-validator/__tests__/datetime-validators.test.js +183 -0
- package/lib/services/entity-validator/__tests__/email-validators.test.js +56 -0
- package/lib/services/entity-validator/__tests__/enumeration-validators.test.js +43 -0
- package/lib/services/entity-validator/__tests__/float-validators.test.js +278 -0
- package/lib/services/entity-validator/__tests__/index.test.js +609 -0
- package/lib/services/entity-validator/__tests__/integer-validators.test.js +278 -0
- package/lib/services/entity-validator/__tests__/relations/attribute-level.test.js +123 -0
- package/lib/services/entity-validator/__tests__/relations/component-level.test.js +275 -0
- package/lib/services/entity-validator/__tests__/relations/dynamic-zone-level.test.js +159 -0
- package/lib/services/entity-validator/__tests__/relations/media-level.test.js +74 -0
- package/lib/services/entity-validator/__tests__/relations/utils/relations.testdata.js +153 -0
- package/lib/services/entity-validator/__tests__/string-validators.test.js +374 -0
- package/lib/services/entity-validator/__tests__/time-validators.test.js +183 -0
- package/lib/services/entity-validator/__tests__/timestamp-validators.test.js +204 -0
- package/lib/services/entity-validator/__tests__/uid-validators.test.js +229 -0
- package/lib/services/metrics/__tests__/admin-user-hash.test.js +41 -0
- package/lib/services/metrics/__tests__/index.test.js +157 -0
- package/lib/services/metrics/__tests__/is-truthy.js +33 -0
- package/lib/services/metrics/__tests__/middleware.test.js +60 -0
- package/lib/services/metrics/__tests__/rate-limiter.test.js +50 -0
- package/lib/services/metrics/__tests__/stringify-deep.test.js +27 -0
- package/lib/services/metrics/sender.js +1 -2
- package/lib/services/webhook-runner.js +4 -4
- package/lib/types/core/commands/index.d.ts +6 -0
- package/lib/utils/__tests__/convert-custom-field-type.test.js +69 -0
- package/lib/utils/__tests__/url-from-segments.test.js +40 -0
- package/lib/utils/fetch.js +23 -0
- package/package.json +17 -16
- /package/lib/commands/{generate-template.js → actions/templates/generate/action.js} +0 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
|
|
2
|
+
<!doctype html>
|
|
3
|
+
<html lang="en">
|
|
4
|
+
|
|
5
|
+
<head>
|
|
6
|
+
<title>Code coverage report for utils</title>
|
|
7
|
+
<meta charset="utf-8" />
|
|
8
|
+
<link rel="stylesheet" href="../prettify.css" />
|
|
9
|
+
<link rel="stylesheet" href="../base.css" />
|
|
10
|
+
<link rel="shortcut icon" type="image/x-icon" href="../favicon.png" />
|
|
11
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
12
|
+
<style type='text/css'>
|
|
13
|
+
.coverage-summary .sorter {
|
|
14
|
+
background-image: url(../sort-arrow-sprite.png);
|
|
15
|
+
}
|
|
16
|
+
</style>
|
|
17
|
+
</head>
|
|
18
|
+
|
|
19
|
+
<body>
|
|
20
|
+
<div class='wrapper'>
|
|
21
|
+
<div class='pad1'>
|
|
22
|
+
<h1><a href="../index.html">All files</a> utils</h1>
|
|
23
|
+
<div class='clearfix'>
|
|
24
|
+
|
|
25
|
+
<div class='fl pad1y space-right2'>
|
|
26
|
+
<span class="strong">92% </span>
|
|
27
|
+
<span class="quiet">Statements</span>
|
|
28
|
+
<span class='fraction'>23/25</span>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
<div class='fl pad1y space-right2'>
|
|
33
|
+
<span class="strong">90.9% </span>
|
|
34
|
+
<span class="quiet">Branches</span>
|
|
35
|
+
<span class='fraction'>10/11</span>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
<div class='fl pad1y space-right2'>
|
|
40
|
+
<span class="strong">100% </span>
|
|
41
|
+
<span class="quiet">Functions</span>
|
|
42
|
+
<span class='fraction'>5/5</span>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
<div class='fl pad1y space-right2'>
|
|
47
|
+
<span class="strong">92% </span>
|
|
48
|
+
<span class="quiet">Lines</span>
|
|
49
|
+
<span class='fraction'>23/25</span>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
</div>
|
|
54
|
+
<p class="quiet">
|
|
55
|
+
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
|
56
|
+
</p>
|
|
57
|
+
<template id="filterTemplate">
|
|
58
|
+
<div class="quiet">
|
|
59
|
+
Filter:
|
|
60
|
+
<input oninput="onInput()" type="search" id="fileSearch">
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
63
|
+
</div>
|
|
64
|
+
<div class='status-line high'></div>
|
|
65
|
+
<div class="pad1">
|
|
66
|
+
<table class="coverage-summary">
|
|
67
|
+
<thead>
|
|
68
|
+
<tr>
|
|
69
|
+
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
|
|
70
|
+
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
|
|
71
|
+
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
|
|
72
|
+
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
73
|
+
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
|
|
74
|
+
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
75
|
+
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
|
|
76
|
+
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
77
|
+
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
|
|
78
|
+
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
79
|
+
</tr>
|
|
80
|
+
</thead>
|
|
81
|
+
<tbody><tr>
|
|
82
|
+
<td class="file high" data-value="convert-custom-field-type.js"><a href="convert-custom-field-type.js.html">convert-custom-field-type.js</a></td>
|
|
83
|
+
<td data-value="100" class="pic high">
|
|
84
|
+
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
|
|
85
|
+
</td>
|
|
86
|
+
<td data-value="100" class="pct high">100%</td>
|
|
87
|
+
<td data-value="12" class="abs high">12/12</td>
|
|
88
|
+
<td data-value="50" class="pct medium">50%</td>
|
|
89
|
+
<td data-value="2" class="abs medium">1/2</td>
|
|
90
|
+
<td data-value="100" class="pct high">100%</td>
|
|
91
|
+
<td data-value="3" class="abs high">3/3</td>
|
|
92
|
+
<td data-value="100" class="pct high">100%</td>
|
|
93
|
+
<td data-value="12" class="abs high">12/12</td>
|
|
94
|
+
</tr>
|
|
95
|
+
|
|
96
|
+
<tr>
|
|
97
|
+
<td class="file medium" data-value="machine-id.js"><a href="machine-id.js.html">machine-id.js</a></td>
|
|
98
|
+
<td data-value="75" class="pic medium">
|
|
99
|
+
<div class="chart"><div class="cover-fill" style="width: 75%"></div><div class="cover-empty" style="width: 25%"></div></div>
|
|
100
|
+
</td>
|
|
101
|
+
<td data-value="75" class="pct medium">75%</td>
|
|
102
|
+
<td data-value="8" class="abs medium">6/8</td>
|
|
103
|
+
<td data-value="100" class="pct high">100%</td>
|
|
104
|
+
<td data-value="0" class="abs high">0/0</td>
|
|
105
|
+
<td data-value="100" class="pct high">100%</td>
|
|
106
|
+
<td data-value="1" class="abs high">1/1</td>
|
|
107
|
+
<td data-value="75" class="pct medium">75%</td>
|
|
108
|
+
<td data-value="8" class="abs medium">6/8</td>
|
|
109
|
+
</tr>
|
|
110
|
+
|
|
111
|
+
<tr>
|
|
112
|
+
<td class="file high" data-value="url-from-segments.js"><a href="url-from-segments.js.html">url-from-segments.js</a></td>
|
|
113
|
+
<td data-value="100" class="pic high">
|
|
114
|
+
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
|
|
115
|
+
</td>
|
|
116
|
+
<td data-value="100" class="pct high">100%</td>
|
|
117
|
+
<td data-value="5" class="abs high">5/5</td>
|
|
118
|
+
<td data-value="100" class="pct high">100%</td>
|
|
119
|
+
<td data-value="9" class="abs high">9/9</td>
|
|
120
|
+
<td data-value="100" class="pct high">100%</td>
|
|
121
|
+
<td data-value="1" class="abs high">1/1</td>
|
|
122
|
+
<td data-value="100" class="pct high">100%</td>
|
|
123
|
+
<td data-value="5" class="abs high">5/5</td>
|
|
124
|
+
</tr>
|
|
125
|
+
|
|
126
|
+
</tbody>
|
|
127
|
+
</table>
|
|
128
|
+
</div>
|
|
129
|
+
<div class='push'></div><!-- for sticky footer -->
|
|
130
|
+
</div><!-- /wrapper -->
|
|
131
|
+
<div class='footer quiet pad2 space-top1 center small'>
|
|
132
|
+
Code coverage generated by
|
|
133
|
+
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
134
|
+
at 2023-03-15T08:52:47.190Z
|
|
135
|
+
</div>
|
|
136
|
+
<script src="../prettify.js"></script>
|
|
137
|
+
<script>
|
|
138
|
+
window.onload = function () {
|
|
139
|
+
prettyPrint();
|
|
140
|
+
};
|
|
141
|
+
</script>
|
|
142
|
+
<script src="../sorter.js"></script>
|
|
143
|
+
<script src="../block-navigation.js"></script>
|
|
144
|
+
</body>
|
|
145
|
+
</html>
|
|
146
|
+
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
|
|
2
|
+
<!doctype html>
|
|
3
|
+
<html lang="en">
|
|
4
|
+
|
|
5
|
+
<head>
|
|
6
|
+
<title>Code coverage report for utils/machine-id.js</title>
|
|
7
|
+
<meta charset="utf-8" />
|
|
8
|
+
<link rel="stylesheet" href="../prettify.css" />
|
|
9
|
+
<link rel="stylesheet" href="../base.css" />
|
|
10
|
+
<link rel="shortcut icon" type="image/x-icon" href="../favicon.png" />
|
|
11
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
12
|
+
<style type='text/css'>
|
|
13
|
+
.coverage-summary .sorter {
|
|
14
|
+
background-image: url(../sort-arrow-sprite.png);
|
|
15
|
+
}
|
|
16
|
+
</style>
|
|
17
|
+
</head>
|
|
18
|
+
|
|
19
|
+
<body>
|
|
20
|
+
<div class='wrapper'>
|
|
21
|
+
<div class='pad1'>
|
|
22
|
+
<h1><a href="../index.html">All files</a> / <a href="index.html">utils</a> machine-id.js</h1>
|
|
23
|
+
<div class='clearfix'>
|
|
24
|
+
|
|
25
|
+
<div class='fl pad1y space-right2'>
|
|
26
|
+
<span class="strong">75% </span>
|
|
27
|
+
<span class="quiet">Statements</span>
|
|
28
|
+
<span class='fraction'>6/8</span>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
<div class='fl pad1y space-right2'>
|
|
33
|
+
<span class="strong">100% </span>
|
|
34
|
+
<span class="quiet">Branches</span>
|
|
35
|
+
<span class='fraction'>0/0</span>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
<div class='fl pad1y space-right2'>
|
|
40
|
+
<span class="strong">100% </span>
|
|
41
|
+
<span class="quiet">Functions</span>
|
|
42
|
+
<span class='fraction'>1/1</span>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
<div class='fl pad1y space-right2'>
|
|
47
|
+
<span class="strong">75% </span>
|
|
48
|
+
<span class="quiet">Lines</span>
|
|
49
|
+
<span class='fraction'>6/8</span>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
</div>
|
|
54
|
+
<p class="quiet">
|
|
55
|
+
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
|
56
|
+
</p>
|
|
57
|
+
<template id="filterTemplate">
|
|
58
|
+
<div class="quiet">
|
|
59
|
+
Filter:
|
|
60
|
+
<input oninput="onInput()" type="search" id="fileSearch">
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
63
|
+
</div>
|
|
64
|
+
<div class='status-line medium'></div>
|
|
65
|
+
<pre><table class="coverage">
|
|
66
|
+
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
|
67
|
+
<a name='L2'></a><a href='#L2'>2</a>
|
|
68
|
+
<a name='L3'></a><a href='#L3'>3</a>
|
|
69
|
+
<a name='L4'></a><a href='#L4'>4</a>
|
|
70
|
+
<a name='L5'></a><a href='#L5'>5</a>
|
|
71
|
+
<a name='L6'></a><a href='#L6'>6</a>
|
|
72
|
+
<a name='L7'></a><a href='#L7'>7</a>
|
|
73
|
+
<a name='L8'></a><a href='#L8'>8</a>
|
|
74
|
+
<a name='L9'></a><a href='#L9'>9</a>
|
|
75
|
+
<a name='L10'></a><a href='#L10'>10</a>
|
|
76
|
+
<a name='L11'></a><a href='#L11'>11</a>
|
|
77
|
+
<a name='L12'></a><a href='#L12'>12</a>
|
|
78
|
+
<a name='L13'></a><a href='#L13'>13</a>
|
|
79
|
+
<a name='L14'></a><a href='#L14'>14</a>
|
|
80
|
+
<a name='L15'></a><a href='#L15'>15</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
81
|
+
<span class="cline-any cline-neutral"> </span>
|
|
82
|
+
<span class="cline-any cline-yes">1x</span>
|
|
83
|
+
<span class="cline-any cline-yes">1x</span>
|
|
84
|
+
<span class="cline-any cline-neutral"> </span>
|
|
85
|
+
<span class="cline-any cline-yes">1x</span>
|
|
86
|
+
<span class="cline-any cline-yes">4x</span>
|
|
87
|
+
<span class="cline-any cline-yes">4x</span>
|
|
88
|
+
<span class="cline-any cline-yes">4x</span>
|
|
89
|
+
<span class="cline-any cline-neutral"> </span>
|
|
90
|
+
<span class="cline-any cline-no"> </span>
|
|
91
|
+
<span class="cline-any cline-no"> </span>
|
|
92
|
+
<span class="cline-any cline-neutral"> </span>
|
|
93
|
+
<span class="cline-any cline-neutral"> </span>
|
|
94
|
+
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">'use strict';
|
|
95
|
+
|
|
96
|
+
const { machineIdSync } = require('node-machine-id');
|
|
97
|
+
const { v4: uuidv4 } = require('uuid');
|
|
98
|
+
|
|
99
|
+
module.exports = () => {
|
|
100
|
+
try {
|
|
101
|
+
const deviceId = machineIdSync();
|
|
102
|
+
return deviceId;
|
|
103
|
+
} catch (error) {
|
|
104
|
+
const deviceId = <span class="cstat-no" title="statement not covered" >uuidv4();</span>
|
|
105
|
+
<span class="cstat-no" title="statement not covered" > return deviceId;</span>
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
</pre></td></tr></table></pre>
|
|
109
|
+
|
|
110
|
+
<div class='push'></div><!-- for sticky footer -->
|
|
111
|
+
</div><!-- /wrapper -->
|
|
112
|
+
<div class='footer quiet pad2 space-top1 center small'>
|
|
113
|
+
Code coverage generated by
|
|
114
|
+
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
115
|
+
at 2023-03-15T08:52:47.190Z
|
|
116
|
+
</div>
|
|
117
|
+
<script src="../prettify.js"></script>
|
|
118
|
+
<script>
|
|
119
|
+
window.onload = function () {
|
|
120
|
+
prettyPrint();
|
|
121
|
+
};
|
|
122
|
+
</script>
|
|
123
|
+
<script src="../sorter.js"></script>
|
|
124
|
+
<script src="../block-navigation.js"></script>
|
|
125
|
+
</body>
|
|
126
|
+
</html>
|
|
127
|
+
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
|
|
2
|
+
<!doctype html>
|
|
3
|
+
<html lang="en">
|
|
4
|
+
|
|
5
|
+
<head>
|
|
6
|
+
<title>Code coverage report for utils/url-from-segments.js</title>
|
|
7
|
+
<meta charset="utf-8" />
|
|
8
|
+
<link rel="stylesheet" href="../prettify.css" />
|
|
9
|
+
<link rel="stylesheet" href="../base.css" />
|
|
10
|
+
<link rel="shortcut icon" type="image/x-icon" href="../favicon.png" />
|
|
11
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
12
|
+
<style type='text/css'>
|
|
13
|
+
.coverage-summary .sorter {
|
|
14
|
+
background-image: url(../sort-arrow-sprite.png);
|
|
15
|
+
}
|
|
16
|
+
</style>
|
|
17
|
+
</head>
|
|
18
|
+
|
|
19
|
+
<body>
|
|
20
|
+
<div class='wrapper'>
|
|
21
|
+
<div class='pad1'>
|
|
22
|
+
<h1><a href="../index.html">All files</a> / <a href="index.html">utils</a> url-from-segments.js</h1>
|
|
23
|
+
<div class='clearfix'>
|
|
24
|
+
|
|
25
|
+
<div class='fl pad1y space-right2'>
|
|
26
|
+
<span class="strong">100% </span>
|
|
27
|
+
<span class="quiet">Statements</span>
|
|
28
|
+
<span class='fraction'>5/5</span>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
<div class='fl pad1y space-right2'>
|
|
33
|
+
<span class="strong">100% </span>
|
|
34
|
+
<span class="quiet">Branches</span>
|
|
35
|
+
<span class='fraction'>9/9</span>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
<div class='fl pad1y space-right2'>
|
|
40
|
+
<span class="strong">100% </span>
|
|
41
|
+
<span class="quiet">Functions</span>
|
|
42
|
+
<span class='fraction'>1/1</span>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
<div class='fl pad1y space-right2'>
|
|
47
|
+
<span class="strong">100% </span>
|
|
48
|
+
<span class="quiet">Lines</span>
|
|
49
|
+
<span class='fraction'>5/5</span>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
</div>
|
|
54
|
+
<p class="quiet">
|
|
55
|
+
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
|
56
|
+
</p>
|
|
57
|
+
<template id="filterTemplate">
|
|
58
|
+
<div class="quiet">
|
|
59
|
+
Filter:
|
|
60
|
+
<input oninput="onInput()" type="search" id="fileSearch">
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
63
|
+
</div>
|
|
64
|
+
<div class='status-line high'></div>
|
|
65
|
+
<pre><table class="coverage">
|
|
66
|
+
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
|
67
|
+
<a name='L2'></a><a href='#L2'>2</a>
|
|
68
|
+
<a name='L3'></a><a href='#L3'>3</a>
|
|
69
|
+
<a name='L4'></a><a href='#L4'>4</a>
|
|
70
|
+
<a name='L5'></a><a href='#L5'>5</a>
|
|
71
|
+
<a name='L6'></a><a href='#L6'>6</a>
|
|
72
|
+
<a name='L7'></a><a href='#L7'>7</a>
|
|
73
|
+
<a name='L8'></a><a href='#L8'>8</a>
|
|
74
|
+
<a name='L9'></a><a href='#L9'>9</a>
|
|
75
|
+
<a name='L10'></a><a href='#L10'>10</a>
|
|
76
|
+
<a name='L11'></a><a href='#L11'>11</a>
|
|
77
|
+
<a name='L12'></a><a href='#L12'>12</a>
|
|
78
|
+
<a name='L13'></a><a href='#L13'>13</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
79
|
+
<span class="cline-any cline-neutral"> </span>
|
|
80
|
+
<span class="cline-any cline-neutral"> </span>
|
|
81
|
+
<span class="cline-any cline-neutral"> </span>
|
|
82
|
+
<span class="cline-any cline-neutral"> </span>
|
|
83
|
+
<span class="cline-any cline-yes">1x</span>
|
|
84
|
+
<span class="cline-any cline-yes">10x</span>
|
|
85
|
+
<span class="cline-any cline-yes">10x</span>
|
|
86
|
+
<span class="cline-any cline-yes">10x</span>
|
|
87
|
+
<span class="cline-any cline-neutral"> </span>
|
|
88
|
+
<span class="cline-any cline-yes">10x</span>
|
|
89
|
+
<span class="cline-any cline-neutral"> </span>
|
|
90
|
+
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">'use strict';
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Returns a url base on hostname, port and ssl options
|
|
94
|
+
*/
|
|
95
|
+
module.exports = ({ hostname, port, ssl = false }) => {
|
|
96
|
+
const protocol = ssl ? 'https' : 'http';
|
|
97
|
+
const defaultPort = ssl ? 443 : 80;
|
|
98
|
+
const portString = port === undefined || parseInt(port, 10) === defaultPort ? '' : `:${port}`;
|
|
99
|
+
|
|
100
|
+
return `${protocol}://${hostname}${portString}`;
|
|
101
|
+
};
|
|
102
|
+
</pre></td></tr></table></pre>
|
|
103
|
+
|
|
104
|
+
<div class='push'></div><!-- for sticky footer -->
|
|
105
|
+
</div><!-- /wrapper -->
|
|
106
|
+
<div class='footer quiet pad2 space-top1 center small'>
|
|
107
|
+
Code coverage generated by
|
|
108
|
+
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
109
|
+
at 2023-03-15T08:52:47.190Z
|
|
110
|
+
</div>
|
|
111
|
+
<script src="../prettify.js"></script>
|
|
112
|
+
<script>
|
|
113
|
+
window.onload = function () {
|
|
114
|
+
prettyPrint();
|
|
115
|
+
};
|
|
116
|
+
</script>
|
|
117
|
+
<script src="../sorter.js"></script>
|
|
118
|
+
<script src="../block-navigation.js"></script>
|
|
119
|
+
</body>
|
|
120
|
+
</html>
|
|
121
|
+
|
package/ee/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
This Strapi Enterprise Edition (EE) supplemental license (this “EE Supplemental License”) governs the use of this software and documentation (collectively, the “EE Software”) by you and any entity you represent (collectively, “You”). If You have separately entered into the Strapi, Inc. Enterprise Agreement (the “Enterprise Agreement”), then this EE Supplemental License hereby incorporates by reference the Enterprise Agreement and modifies the Enterprise Agreement solely to the extent set forth herein. If You have separately entered into the Strapi, Inc. Subscription Agreement (the “Subscription Agreement”), then this EE Supplemental License hereby incorporates by reference the Agreement and modifies the Subscription Agreement solely to the extent set forth herein. If You have not entered into either the Enterprise Agreement or the Subscription Agreement, then You may use the EE Software solely as set forth in Section 2 below.
|
|
2
|
+
|
|
3
|
+
In the event of a direct conflict between the terms of this EE Supplemental License and the terms of the Enterprise Agreement or the Subscription Agreement, as applicable, the terms of this EE Supplemental License will control. Except to the extent modified by this EE Supplemental License, the Enterprise Agreement or the Subscription Agreement, as applicable, remain in full force and effect in accordance with its terms.
|
|
4
|
+
|
|
5
|
+
By using the EE Software, You hereby agree to the below terms and conditions.
|
|
6
|
+
|
|
7
|
+
1. Notwithstanding any terms to the contrary in the Enterprise Agreement or Subscription Agreement, You may copy, modify and publish patches to the EE Software in a production environment (such copies, “Production Copies,” such modifications, “Production Modifications” and such patches, “Production Patches”) if and only if (a) You have agreed to, and are in full compliance with, the Enterprise Agreement or Subscription Agreement, as applicable, and (b) You have a valid license to the EE Software for the correct number of projects. You agree that Strapi and/or its licensors (as applicable) will own all right, title and interest in and to all such Production Copies, Production Modifications and Production Patches. You may display and/or distribute such Production Copies, Production Modifications and Production Patches if and only if (i) You have a valid license to the EE Software for the correct number of projects and (ii) You are in compliance with the Enterprise Agreement or Subscription Agreement, as applicable. You hereby assign to Strapi all right, title and interest in and to all Production Copies, Production Modifications and Production Patches, including all intellectual property rights embodied in or related to the foregoing.
|
|
8
|
+
|
|
9
|
+
2. Notwithstanding the foregoing, You may copy and modify the EE Software solely for development and testing purposes (such copies, “Development Copies” and such modifications, “Development Modifications”) with or without a license to the EE Software if your use is in compliance with this Section 2. You agree that Strapi and/or its licensors (as applicable) will own all right, title and interest in and to all Development Copies and Development Modifications and You hereby assign to Strapi all right, title and interest in and to all Development Copies and Development Modifications, including all intellectual property rights embodied in or related to the foregoing. If You do not have a license to the EE Software, then You further agree as follows:
|
|
10
|
+
|
|
11
|
+
Other than as expressly set forth in this Section 2, You may not (a) copy or modify the EE Software, (b) create derivative works of the EE Software, (c) remove or modify any notice of any patent, copyright, trademark, or other proprietary rights that appear on or in the EE Software, (d) reverse engineer, decompile, translate, disassemble, or discover the source code of all or any portion of the EE Software, (e) publicly display all or any part of the EE Software, (f) distribute, disclose, market, lease, publish, merge, resell, assign, loan, sublicense, rent, or transfer the EE Software to any third party, (g) use the EE Software for any dial-up, remote access, interactive, or other on-line or hosted service, or to provide a service bureau, time share, or other services to third parties, (h) merge the EE Software into another product, (i) disclose the results of any EE Software performance benchmarks or test results to any third party without Strapi’s prior written consent, (j) use any trademarks, logos, service marks, trade names of Strapi, or any portion thereof, without Strapi’s prior written consent, (k) use the EE Software, or any portion thereof, in a manner that does not comply with applicable law, regulations, or governmental orders, or (l) use or store the EE Software on equipment not owned or controlled by Customer.
|
|
12
|
+
|
|
13
|
+
THE EE SOFTWARE IS PROVIDED ON AN “AS IS” BASIS WITHOUT ANY REPRESENTATIONS, WARRANTIES, COVENANTS, OR CONDITIONS OF ANY KIND (EXPRESS OR IMPLIED, STATUTORY OR OTHERWISE), INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, TITLE, FITNESS FOR A PARTICULAR PURPOSE, OR NONINFRINGEMENT. FURTHER, STRAPI DOES NOT REPRESENT OR WARRANT THAT (A) THE ACCESS TO OR USE OF THE EE SOFTWARE WILL BE SECURE, TIMELY, UNINTERRUPTED, ERROR-FREE, OR OPERATE IN COMBINATION WITH ANY OTHER HARDWARE, SOFTWARE, SYSTEM, OR DATA, (B) THE EE SOFTWARE WILL MEET YOUR REQUIREMENTS OR EXPECTATIONS, OR OTHERWISE PRODUCE ANY PARTICULAR RESULTS, (C) ERRORS OR DEFECTS WILL BE CORRECTED, PATCHES OR WORKAROUNDS WILL BE PROVIDED, OR STRAPI WILL DETECT ANY BUG IN THE EE SOFTWARE, (D) THE SOFTWARE IS FREE OF VIRUSES OR OTHER HARMFUL COMPONENTS, OR (E) THIRD-PARTY DISRUPTIONS OR SECURITY BREACHES OF THE EE SOFTWARE WILL BE PREVENTED.
|
|
14
|
+
|
|
15
|
+
STRAPI WILL NOT BE LIABLE FOR ANY LOSS OF PROFITS OR ANY INDIRECT, SPECIAL, INCIDENTAL, RELIANCE, OR CONSEQUENTIAL DAMAGES OF ANY KIND, REGARDLESS OF THE FORM OF ACTION, WHETHER IN CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY, OR OTHERWISE, EVEN IF INFORMED OF THE POSSIBILITY OF SUCH DAMAGES IN ADVANCE.
|
|
16
|
+
|
|
17
|
+
STRAPI’S ENTIRE LIABILITY TO YOU FOR USE OF THE EE SOFTWARE WILL NOT EXCEED $100.
|
|
18
|
+
|
|
19
|
+
3. You are not granted any other rights beyond what is expressly stated herein and in the Enterprise Agreement or Subscription Agreement, as applicable.
|
|
20
|
+
|
|
21
|
+
4. This EE Supplemental License does not apply to Strapi software that is distributed as part of the Strapi Community Edition (CE) (the “CE Software”).
|
package/ee/index.js
CHANGED
|
@@ -105,7 +105,9 @@ const onlineUpdate = async ({ strapi }) => {
|
|
|
105
105
|
};
|
|
106
106
|
|
|
107
107
|
const license = shouldContactRegistry
|
|
108
|
-
? await fetchLicense(ee.licenseInfo.licenseKey, strapi.config.get('uuid')).catch(
|
|
108
|
+
? await fetchLicense({ strapi }, ee.licenseInfo.licenseKey, strapi.config.get('uuid')).catch(
|
|
109
|
+
fallback
|
|
110
|
+
)
|
|
109
111
|
: storedInfo.license;
|
|
110
112
|
|
|
111
113
|
if (license) {
|
package/ee/license.js
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
const fs = require('fs');
|
|
4
4
|
const { join } = require('path');
|
|
5
5
|
const crypto = require('crypto');
|
|
6
|
-
const fetch = require('node-fetch');
|
|
7
6
|
|
|
8
7
|
const machineId = require('../lib/utils/machine-id');
|
|
9
8
|
|
|
@@ -69,12 +68,14 @@ const throwError = () => {
|
|
|
69
68
|
throw new LicenseCheckError('Could not proceed to the online validation of your license.', true);
|
|
70
69
|
};
|
|
71
70
|
|
|
72
|
-
const fetchLicense = async (key, projectId) => {
|
|
73
|
-
const response = await
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
71
|
+
const fetchLicense = async ({ strapi }, key, projectId) => {
|
|
72
|
+
const response = await strapi
|
|
73
|
+
.fetch(`https://license.strapi.io/api/licenses/validate`, {
|
|
74
|
+
method: 'POST',
|
|
75
|
+
headers: { 'Content-Type': 'application/json' },
|
|
76
|
+
body: JSON.stringify({ key, projectId, deviceId: machineId() }),
|
|
77
|
+
})
|
|
78
|
+
.catch(throwError);
|
|
78
79
|
|
|
79
80
|
const contentType = response.headers.get('Content-Type');
|
|
80
81
|
|
package/lib/Strapi.js
CHANGED
|
@@ -27,6 +27,7 @@ const createCustomFields = require('./services/custom-fields');
|
|
|
27
27
|
const createContentAPI = require('./services/content-api');
|
|
28
28
|
const createUpdateNotifier = require('./utils/update-notifier');
|
|
29
29
|
const createStartupLogger = require('./utils/startup-logger');
|
|
30
|
+
const createStrapiFetch = require('./utils/fetch');
|
|
30
31
|
const { LIFECYCLES } = require('./utils/lifecycles');
|
|
31
32
|
const ee = require('./utils/ee');
|
|
32
33
|
const contentTypesRegistry = require('./core/registries/content-types');
|
|
@@ -118,6 +119,7 @@ class Strapi {
|
|
|
118
119
|
this.telemetry = createTelemetry(this);
|
|
119
120
|
this.requestContext = requestContext;
|
|
120
121
|
this.customFields = createCustomFields(this);
|
|
122
|
+
this.fetch = createStrapiFetch(this);
|
|
121
123
|
|
|
122
124
|
createUpdateNotifier(this).notify();
|
|
123
125
|
|
|
@@ -393,6 +395,7 @@ class Strapi {
|
|
|
393
395
|
eventHub: this.eventHub,
|
|
394
396
|
logger: this.log,
|
|
395
397
|
configuration: this.config.get('server.webhooks', {}),
|
|
398
|
+
fetch: this.fetch,
|
|
396
399
|
});
|
|
397
400
|
|
|
398
401
|
this.registerInternalHooks();
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const { buildStrapiCommand } = require('../index');
|
|
4
|
+
|
|
5
|
+
const consoleMock = {
|
|
6
|
+
error: jest.spyOn(console, 'error').mockImplementation(() => {}),
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
describe('commands', () => {
|
|
10
|
+
afterEach(() => {
|
|
11
|
+
consoleMock.error.mockClear();
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
describe('buildStrapiCommand', () => {
|
|
15
|
+
it('loads all commands without error', () => {
|
|
16
|
+
buildStrapiCommand();
|
|
17
|
+
expect(consoleMock.error).not.toHaveBeenCalled();
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const expectExit = async (code, fn) => {
|
|
4
|
+
const exit = jest.spyOn(process, 'exit').mockImplementation((number) => {
|
|
5
|
+
throw new Error(`process.exit: ${number}`);
|
|
6
|
+
});
|
|
7
|
+
await expect(async () => {
|
|
8
|
+
await fn();
|
|
9
|
+
}).rejects.toThrow('process.exit');
|
|
10
|
+
expect(exit).toHaveBeenCalledWith(code);
|
|
11
|
+
exit.mockRestore();
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
module.exports = {
|
|
15
|
+
expectExit,
|
|
16
|
+
};
|