@@ -87,6 +87,8 @@ async function bootStore() {
8787
8888interface Answer { status: number; body: any }
8989interface Door {
90+ /** Whether this transport serves `DELETE /meta/:type/:name` at all (the dispatcher answers `405`). */
91+ readonly deletes: boolean;
9092 send(method: 'GET' | 'PUT' | 'DELETE', path: string, query?: Record<string, string>, item?: unknown): Promise<Answer>;
9193 boundTo(name: string): Promise<Array<string | null>>;
9294}
@@ -111,6 +113,7 @@ async function bootRestServer(): Promise<Door> {
111113 rest.resolveExecCtx = async () => clone(AUTHOR);
112114 rest.registerRoutes();
113115 return {
116+ deletes: true,
114117 boundTo,
115118 send: async (method, path, query = {}, item) => {
116119 const s = path.replace(/^\/meta\//, '').split('/');
@@ -147,6 +150,7 @@ async function bootCatchAll(): Promise<Door> {
147150 const dispatcher = new HttpDispatcher(kernel);
148151 (dispatcher as any).timedResolveExecutionContext = async () => clone(AUTHOR);
149152 return {
153+ deletes: false,
150154 boundTo,
151155 send: async (method, path, query = {}, item) => {
152156 const url = new URL(`http://localhost${PREFIX}${path}`);
@@ -187,12 +191,14 @@ const SPELLINGS: ReadonlyArray<readonly [string, (name: string) => [string, Reco
187191
188192for (const [doorName, boot] of DOORS) {
189193 describe(`[#28337] ${doorName}: the layered view of a name two packages hold`, () => {
190- it('naming no package, both spellings answer the package-less save\'s and delete\'s own 409', async () => {
194+ it('naming no package, both spellings answer the package-less writes\' own 409', async () => {
191195 const door = await boot();
192196 const save = await door.send('PUT', '/meta/dashboard/twin_dash', {}, dashboard('twin_dash', 'edited'));
193- const remove = await door.send('DELETE', '/meta/dashboard/twin_dash');
194197 expect([save.status, codeOf(save.body)], JSON.stringify(save.body)).toEqual([409, 'RESOURCE_CONFLICT']);
195- expect([remove.status, codeOf(remove.body)], JSON.stringify(remove.body)).toEqual([409, 'RESOURCE_CONFLICT']);
198+ if (door.deletes) {
199+ const remove = await door.send('DELETE', '/meta/dashboard/twin_dash');
200+ expect([remove.status, codeOf(remove.body)], JSON.stringify(remove.body)).toEqual([409, 'RESOURCE_CONFLICT']);
201+ }
196202 for (const [spelling, at] of SPELLINGS) {
197203 const [path, query] = at('twin_dash');
198204 const read = await door.send('GET', path, query);
0 commit comments