Files
2026-05-11 22:07:17 +02:00

14 lines
493 B
TypeScript

import { describe, expect, it } from 'vitest';
import { exportCharacterJson, importCharacterFromText } from '$lib/storage/io';
import { newCharacter } from '$lib/characters/default';
describe('io', () => {
it('roundtrips JSON', () => {
const c = newCharacter({ name: 'IO', id: '00000000-0000-4000-8000-0000000000aa' });
const json = exportCharacterJson(c);
const back = importCharacterFromText(json, 'json');
expect(back.meta.name).toBe('IO');
expect(back.id).toBe(c.id);
});
});