ts-tiled-converter
Version:
Typescript library to convert tiled map to Studio map
16 lines (13 loc) • 598 B
text/typescript
import { readMap } from '../reader/readMap';
import { throwIfError } from '../util';
import { assertMapValidity } from './assertMapValidity';
describe('assertMapValidity', () => {
it('returns an error if the map is infinite', () => {
const map = throwIfError(readMap('lib/mockData/infiniteMap.tmx'));
expect(assertMapValidity(map.map)).toEqual(new Error('Infinite maps are not supported.'));
});
it('returns true otherwise', () => {
const map = throwIfError(readMap('lib/mockData/base64Gzip.tmx'));
expect(assertMapValidity(map.map)).toEqual(true);
});
});