可达性 E2E:创建游戏失败时先退出再解引用封面键
- 在 gameId 取值后补 if (!gameId) process.exit(1) - 创建失败时 created.data 为空,提前取 coverObjectKey 会抛未捕获 TypeError 打崩脚本
This commit is contained in:
@@ -211,6 +211,9 @@ async function publishFixtureGame(adminToken, stamp, title) {
|
||||
formData: publishFormData(metadata, { cover }),
|
||||
});
|
||||
const gameId = created.data?.id;
|
||||
// 创建失败时 created.data 为空,下面解引用 coverObjectKey 会抛未捕获 TypeError 把脚本打崩,
|
||||
// 拿不到成组的可达性 check 结论;先退出,保留一条正常的失败退出码。
|
||||
if (!gameId) process.exit(1);
|
||||
const version = await api(`/api/game-distribution/games/${gameId}/versions`, {
|
||||
method: 'POST',
|
||||
token: author,
|
||||
|
||||
Reference in New Issue
Block a user