Add Prettier and ESLint tooling (Refs #77)
This commit is contained in:
@@ -11,22 +11,41 @@ import { serverTitle } from '../../src/lib/ui/server-labels.js';
|
||||
|
||||
describe('T6 map identity', () => {
|
||||
it.each([
|
||||
['towngrief', 'zm_transit'], ['farmgrief', 'zm_transit'], ['busdepotgrief', 'zm_transit'],
|
||||
['cellblock', 'zm_prison'], ['buriedgrief', 'zm_buried'], ['diner', 'zm_transit_dr'], ['buriedturned', 'zm_buried']
|
||||
])('excludes %s without falling back to a supported variant of the same engine map', (slug, canonical) => {
|
||||
expect(zombieMapBySlug('t6', slug)).toBeUndefined();
|
||||
expect(selectedZombieMap('t6', canonical, slug)).toBeUndefined();
|
||||
expect(parseServerName(`t6_zombie_${slug}_1`)?.mapCanonical).toBeNull();
|
||||
});
|
||||
['towngrief', 'zm_transit'],
|
||||
['farmgrief', 'zm_transit'],
|
||||
['busdepotgrief', 'zm_transit'],
|
||||
['cellblock', 'zm_prison'],
|
||||
['buriedgrief', 'zm_buried'],
|
||||
['diner', 'zm_transit_dr'],
|
||||
['buriedturned', 'zm_buried']
|
||||
])(
|
||||
'excludes %s without falling back to a supported variant of the same engine map',
|
||||
(slug, canonical) => {
|
||||
expect(zombieMapBySlug('t6', slug)).toBeUndefined();
|
||||
expect(selectedZombieMap('t6', canonical, slug)).toBeUndefined();
|
||||
expect(parseServerName(`t6_zombie_${slug}_1`)?.mapCanonical).toBeNull();
|
||||
}
|
||||
);
|
||||
|
||||
it.each(T6_ZOMBIE_MAPS)('parses and labels $friendly without losing its variant', (map) => {
|
||||
const name = `t6_zombie_${map.slug}_2`;
|
||||
expect(parseServerName(name)).toMatchObject({ game: 't6', gameMode: 'zombie', mapCanonical: map.canonical, mapSlug: map.slug, lobby: 2 });
|
||||
expect(parseServerName(name)).toMatchObject({
|
||||
game: 't6',
|
||||
gameMode: 'zombie',
|
||||
mapCanonical: map.canonical,
|
||||
mapSlug: map.slug,
|
||||
lobby: 2
|
||||
});
|
||||
expect(serverTitle(name)).toBe(`${map.friendly} · Lobby 2`);
|
||||
});
|
||||
|
||||
it('does not interpret another game or mode through the T5 catalog', () => {
|
||||
for (const name of ['t6_zombie_theater_1', 't5_zombie_tomb_1', 't5_mp_theater_1', 'iw5_theater_1']) {
|
||||
for (const name of [
|
||||
't6_zombie_theater_1',
|
||||
't5_zombie_tomb_1',
|
||||
't5_mp_theater_1',
|
||||
'iw5_theater_1'
|
||||
]) {
|
||||
expect(parseServerName(name)?.mapCanonical).toBeNull();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user