feat: refresh creation config and visual assets
This commit is contained in:
@@ -6,8 +6,10 @@ import {afterEach, describe, expect, test, vi} from 'vitest';
|
||||
|
||||
import {
|
||||
DevRunner,
|
||||
buildSpacetimePublishArgs,
|
||||
createDevServerSpawnOptions,
|
||||
createWatchConfigs,
|
||||
isSpacetimePublishPermissionError,
|
||||
parseArgs,
|
||||
shouldAcceptWatchEvent,
|
||||
} from './dev.mjs';
|
||||
@@ -210,6 +212,34 @@ describe('dev scheduler watch routing', () => {
|
||||
});
|
||||
|
||||
describe('dev scheduler spacetime refresh', () => {
|
||||
test('本地发布 403 时识别为身份权限问题,避免误杀 standalone', () => {
|
||||
const error = new Error(
|
||||
'Pre-publish check failed with status 403 Forbidden: c200... is not authorized to perform action on database c200...: update database',
|
||||
);
|
||||
|
||||
expect(isSpacetimePublishPermissionError(error)).toBe(true);
|
||||
expect(isSpacetimePublishPermissionError(new Error('No database target matches'))).toBe(false);
|
||||
});
|
||||
|
||||
test('发布 spacetime-module 时忽略 spacetime.json 以免覆盖显式数据库', () => {
|
||||
const args = buildSpacetimePublishArgs({
|
||||
database: 'xushi-p4wfr',
|
||||
preserveDatabase: false,
|
||||
server: 'http://127.0.0.1:3101',
|
||||
});
|
||||
|
||||
expect(args).toContain('--no-config');
|
||||
expect(args).toEqual(
|
||||
expect.arrayContaining([
|
||||
'publish',
|
||||
'xushi-p4wfr',
|
||||
'--server',
|
||||
'http://127.0.0.1:3101',
|
||||
'-c=on-conflict',
|
||||
]),
|
||||
);
|
||||
});
|
||||
|
||||
test('手动刷新 spacetime 只重新发布模块,不重启 standalone 进程', async () => {
|
||||
const {explicitOptions, options} = parseArgs([], {});
|
||||
const runner = new DevRunner(options, {}, explicitOptions);
|
||||
|
||||
Reference in New Issue
Block a user