Files
Tony 3bc1cc248d chore: bump to msw v3 (#23463)
* chore: bump to msw v3

* refactor: anti-slop

* test: use vi.stubEnv for REDIS_URL in redis error test

* refactor: move remote debugging registration into a conditional block

* chore: add code coverage upload for github
2026-10-03 06:36:19 +08:00

25 lines
871 B
TypeScript

import { assert, describe, expect, it } from 'vitest';
import api from '@/api';
import { namespaces } from '@/registry';
describe('api/namespace/one', () => {
const nestedKey = Object.keys(namespaces).find((key) => key.includes('/'));
it('serves a single namespace over HTTP', async () => {
expect(namespaces.github).toBeDefined();
const response = await api.request('/namespace/github');
expect(response.status).toBe(200);
const data = await response.json();
expect(data).toEqual(namespaces.github);
});
it('serves a nested namespace over HTTP', async () => {
assert(nestedKey);
const response = await api.request(`/namespace/${nestedKey}`);
expect(response.status).toBe(200);
const data = await response.json();
expect(data).toEqual(namespaces[nestedKey]);
});
});