miaoda-game-devkit 0.2.4 → 0.2.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.
|
@@ -217,7 +217,7 @@ function auditGameplayCollection(options2, file, tests) {
|
|
|
217
217
|
const matches = actual.filter((test) => test.metadata?.id === contract.id);
|
|
218
218
|
if (matches.length === 0) {
|
|
219
219
|
issues.push(
|
|
220
|
-
`\
|
|
220
|
+
`\u6CA1\u6709\u627E\u5230\u68C0\u67E5\u9879 "${contract.id}" \u7684\u53EF\u6267\u884C\u6D4B\u8BD5\uFF08${normalizedFile}\uFF09\u3002`
|
|
221
221
|
);
|
|
222
222
|
} else if (matches.length > 1) {
|
|
223
223
|
issues.push(
|
|
@@ -650,7 +650,7 @@ describe("gameplay audit", () => {
|
|
|
650
650
|
expect(result).toEqual({
|
|
651
651
|
passed: false,
|
|
652
652
|
issues: [
|
|
653
|
-
'\
|
|
653
|
+
'\u6CA1\u6709\u627E\u5230\u68C0\u67E5\u9879 "gameplay.main-flow" \u7684\u53EF\u6267\u884C\u6D4B\u8BD5\uFF08tests/gameplay.test.ts\uFF09\u3002'
|
|
654
654
|
]
|
|
655
655
|
});
|
|
656
656
|
});
|
|
@@ -222,7 +222,7 @@ function auditGameplayCollection(options, file, tests) {
|
|
|
222
222
|
const matches = actual.filter((test) => test.metadata?.id === contract.id);
|
|
223
223
|
if (matches.length === 0) {
|
|
224
224
|
issues.push(
|
|
225
|
-
`\
|
|
225
|
+
`\u6CA1\u6709\u627E\u5230\u68C0\u67E5\u9879 "${contract.id}" \u7684\u53EF\u6267\u884C\u6D4B\u8BD5\uFF08${normalizedFile}\uFF09\u3002`
|
|
226
226
|
);
|
|
227
227
|
} else if (matches.length > 1) {
|
|
228
228
|
issues.push(
|
|
@@ -499,7 +499,17 @@ var GameplayAuditReporter = class {
|
|
|
499
499
|
for (const issue of result.issues) this.reportPreflightIssue(issue);
|
|
500
500
|
}
|
|
501
501
|
/** 在测试运行结束后汇总全部 contract、Ledger 和 Scene registry,并决定命令退出码。 */
|
|
502
|
-
onTestRunEnd(testModules) {
|
|
502
|
+
onTestRunEnd(testModules, _unhandledErrors = [], reason = "passed") {
|
|
503
|
+
const collectionFailed = reason === "failed" && testModules.some(
|
|
504
|
+
(testModule) => testModule.state() === "failed" && [...testModule.children.allTests()].length === 0
|
|
505
|
+
);
|
|
506
|
+
if (collectionFailed) {
|
|
507
|
+
console.error(
|
|
508
|
+
"\nGAMEPLAY_AUDIT: NOT RUN\n\u73A9\u6CD5\u6D4B\u8BD5\u6587\u4EF6\u65E0\u6CD5\u52A0\u8F7D\uFF0C\u56E0\u6B64\u65E0\u6CD5\u68C0\u67E5\u6E38\u620F\u884C\u4E3A\u3002\u8BF7\u5148\u4FEE\u590D Vitest \u4E0A\u65B9\u663E\u793A\u7684\u8BED\u6CD5\u6216\u5BFC\u5165\u9519\u8BEF\uFF0C\u518D\u8FD0\u884C pnpm test\u3002"
|
|
509
|
+
);
|
|
510
|
+
process.exitCode = 1;
|
|
511
|
+
return;
|
|
512
|
+
}
|
|
503
513
|
const tests = testModules.flatMap(
|
|
504
514
|
(testModule) => [...testModule.children.allTests()].map(toAuditTest)
|
|
505
515
|
);
|
package/dist/vitest-config.js
CHANGED
|
@@ -242,7 +242,7 @@ function auditGameplayCollection(options, file, tests) {
|
|
|
242
242
|
const matches = actual.filter((test) => test.metadata?.id === contract.id);
|
|
243
243
|
if (matches.length === 0) {
|
|
244
244
|
issues.push(
|
|
245
|
-
`\
|
|
245
|
+
`\u6CA1\u6709\u627E\u5230\u68C0\u67E5\u9879 "${contract.id}" \u7684\u53EF\u6267\u884C\u6D4B\u8BD5\uFF08${normalizedFile}\uFF09\u3002`
|
|
246
246
|
);
|
|
247
247
|
} else if (matches.length > 1) {
|
|
248
248
|
issues.push(
|
|
@@ -519,7 +519,17 @@ var GameplayAuditReporter = class {
|
|
|
519
519
|
for (const issue of result.issues) this.reportPreflightIssue(issue);
|
|
520
520
|
}
|
|
521
521
|
/** 在测试运行结束后汇总全部 contract、Ledger 和 Scene registry,并决定命令退出码。 */
|
|
522
|
-
onTestRunEnd(testModules) {
|
|
522
|
+
onTestRunEnd(testModules, _unhandledErrors = [], reason = "passed") {
|
|
523
|
+
const collectionFailed = reason === "failed" && testModules.some(
|
|
524
|
+
(testModule) => testModule.state() === "failed" && [...testModule.children.allTests()].length === 0
|
|
525
|
+
);
|
|
526
|
+
if (collectionFailed) {
|
|
527
|
+
console.error(
|
|
528
|
+
"\nGAMEPLAY_AUDIT: NOT RUN\n\u73A9\u6CD5\u6D4B\u8BD5\u6587\u4EF6\u65E0\u6CD5\u52A0\u8F7D\uFF0C\u56E0\u6B64\u65E0\u6CD5\u68C0\u67E5\u6E38\u620F\u884C\u4E3A\u3002\u8BF7\u5148\u4FEE\u590D Vitest \u4E0A\u65B9\u663E\u793A\u7684\u8BED\u6CD5\u6216\u5BFC\u5165\u9519\u8BEF\uFF0C\u518D\u8FD0\u884C pnpm test\u3002"
|
|
529
|
+
);
|
|
530
|
+
process.exitCode = 1;
|
|
531
|
+
return;
|
|
532
|
+
}
|
|
523
533
|
const tests = testModules.flatMap(
|
|
524
534
|
(testModule) => [...testModule.children.allTests()].map(toAuditTest)
|
|
525
535
|
);
|
package/dist/vitest-config.mjs
CHANGED
|
@@ -218,7 +218,7 @@ function auditGameplayCollection(options, file, tests) {
|
|
|
218
218
|
const matches = actual.filter((test) => test.metadata?.id === contract.id);
|
|
219
219
|
if (matches.length === 0) {
|
|
220
220
|
issues.push(
|
|
221
|
-
`\
|
|
221
|
+
`\u6CA1\u6709\u627E\u5230\u68C0\u67E5\u9879 "${contract.id}" \u7684\u53EF\u6267\u884C\u6D4B\u8BD5\uFF08${normalizedFile}\uFF09\u3002`
|
|
222
222
|
);
|
|
223
223
|
} else if (matches.length > 1) {
|
|
224
224
|
issues.push(
|
|
@@ -495,7 +495,17 @@ var GameplayAuditReporter = class {
|
|
|
495
495
|
for (const issue of result.issues) this.reportPreflightIssue(issue);
|
|
496
496
|
}
|
|
497
497
|
/** 在测试运行结束后汇总全部 contract、Ledger 和 Scene registry,并决定命令退出码。 */
|
|
498
|
-
onTestRunEnd(testModules) {
|
|
498
|
+
onTestRunEnd(testModules, _unhandledErrors = [], reason = "passed") {
|
|
499
|
+
const collectionFailed = reason === "failed" && testModules.some(
|
|
500
|
+
(testModule) => testModule.state() === "failed" && [...testModule.children.allTests()].length === 0
|
|
501
|
+
);
|
|
502
|
+
if (collectionFailed) {
|
|
503
|
+
console.error(
|
|
504
|
+
"\nGAMEPLAY_AUDIT: NOT RUN\n\u73A9\u6CD5\u6D4B\u8BD5\u6587\u4EF6\u65E0\u6CD5\u52A0\u8F7D\uFF0C\u56E0\u6B64\u65E0\u6CD5\u68C0\u67E5\u6E38\u620F\u884C\u4E3A\u3002\u8BF7\u5148\u4FEE\u590D Vitest \u4E0A\u65B9\u663E\u793A\u7684\u8BED\u6CD5\u6216\u5BFC\u5165\u9519\u8BEF\uFF0C\u518D\u8FD0\u884C pnpm test\u3002"
|
|
505
|
+
);
|
|
506
|
+
process.exitCode = 1;
|
|
507
|
+
return;
|
|
508
|
+
}
|
|
499
509
|
const tests = testModules.flatMap(
|
|
500
510
|
(testModule) => [...testModule.children.allTests()].map(toAuditTest)
|
|
501
511
|
);
|