refactor(test): convert TextLayerMock to class syntax in PdfViewer spec
Prototype-style assignment was a vi.mock hoisting artifact from the old version of the file. Rest of the codebase uses class syntax — aligning. Addresses Felix Brandt round-4 suggestion on PR #536. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -7,9 +7,12 @@ import PdfViewer from './PdfViewer.svelte';
|
||||
afterEach(cleanup);
|
||||
|
||||
function makeFakePdfjsLib() {
|
||||
function TextLayerMock() {}
|
||||
TextLayerMock.prototype.render = () => Promise.resolve();
|
||||
TextLayerMock.prototype.cancel = () => {};
|
||||
class TextLayerMock {
|
||||
render() {
|
||||
return Promise.resolve();
|
||||
}
|
||||
cancel() {}
|
||||
}
|
||||
|
||||
return {
|
||||
GlobalWorkerOptions: { workerSrc: '' },
|
||||
|
||||
Reference in New Issue
Block a user