Upgrade react-scripts, switch from adm-zip to fflate.

adm-zip did not play nice with compiling to the browser after upgrading react-scripts
This commit is contained in:
Przemek Więch
2025-01-10 23:55:16 +01:00
parent c54c70b874
commit c208452553
6 changed files with 21585 additions and 26811 deletions

View File

@@ -0,0 +1,23 @@
import {loadFile} from './load_data';
import {readFileSync} from 'fs';
import {Blob} from 'buffer';
describe('loadFile', () => {
global.URL.createObjectURL = jest.fn();
it('loads GEDCOM file', async () => {
const file = readFileSync('src/datasource/testdata/test.ged');
const blob = new Blob([file]);
const {gedcom, images} = await loadFile(blob);
expect(gedcom.length).toBe(4408);
expect(images).toEqual(new Map());
});
it('loads GEDZIP file', async () => {
const file = readFileSync('src/datasource/testdata/test.gdz');
const blob = new Blob([file]);
const {gedcom, images} = await loadFile(blob);
expect(gedcom.length).toBe(4408);
expect(images.size).toBe(1);
});
});