Chore: resolve dynamic import warnings from pdfjs, again (#9924)

This commit is contained in:
shamoon
2025-05-12 21:04:18 -07:00
committed by GitHub
parent 344cc70cd5
commit 2c9e690dfb
2 changed files with 14 additions and 16 deletions

View File

@@ -121,19 +121,4 @@ HTMLCanvasElement.prototype.getContext = <
typeof HTMLCanvasElement.prototype.getContext
>jest.fn()
// pdfjs
jest.mock('pdfjs-dist', () => ({
getDocument: jest.fn(() => ({
promise: Promise.resolve({ numPages: 3 }),
})),
GlobalWorkerOptions: { workerSrc: '' },
VerbosityLevel: { ERRORS: 0 },
globalThis: {
pdfjsLib: {
GlobalWorkerOptions: {
workerSrc: '',
},
},
},
}))
jest.mock('pdfjs-dist/web/pdf_viewer', () => ({}))
jest.mock('pdfjs-dist')