fix(tests): update WasmProvider tests to handle unversioned CDN URLs from older releases

This commit is contained in:
alam00000 committed 2026-10-28 12:27:28 +05:30
1 parent d8210be3c1
commit 27dfe79636
2 files changed
+20 -2

No files matched your search

+15
View File
@@ -39,6 +39,21 @@ describe('WasmProvider saved URLs', () => {
expect(storedConfig()).toEqual({});
});
it('replaces an unversioned CDN URL saved by older releases', async () => {
const provider = await loadProvider({
ghostscript: 'https://cdn.jsdelivr.net/npm/@bentopdf/gs-wasm/assets/',
cpdf: 'https://cdn.jsdelivr.net/npm/coherentpdf/dist/',
});
expect(provider.getUrl('ghostscript')).toBe(
'https://cdn.jsdelivr.net/npm/@bentopdf/gs-wasm@0.1.1/assets/'
);
expect(provider.getUrl('cpdf')).toBe(
'https://cdn.jsdelivr.net/npm/coherentpdf@2.5.5/dist/'
);
expect(storedConfig()).toEqual({});
});
it('keeps a self-hosted URL the user chose', async () => {
const provider = await loadProvider({
pymupdf: 'http://localhost/wasm/pymupdf/',