Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions jest.setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,25 @@ jest.mock('pdfjs-dist', () => ({
version: '4.0.0',
}));

// Mock jsPDF
jest.mock('jspdf', () => ({
jsPDF: jest.fn().mockImplementation(() => ({
text: jest.fn(),
setFontSize: jest.fn(),
setFont: jest.fn(),
setTextColor: jest.fn(),
save: jest.fn(),
addPage: jest.fn(),
splitTextToSize: jest.fn((text: string) => [text]),
internal: {
pageSize: {
getWidth: jest.fn(() => 210),
getHeight: jest.fn(() => 297),
},
},
})),
}));

// Suppress console errors and warnings in tests
const originalError = console.error;
const originalWarn = console.warn;
Expand Down
5 changes: 5 additions & 0 deletions next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
},
],
},
experimental: {
// Add the development server's origin to allow cross-origin requests.
// This is necessary for environments like cloud-based IDEs.
allowedDevOrigins: ["*.cloudworkstations.dev"],

Check failure on line 30 in next.config.ts

View workflow job for this annotation

GitHub Actions / Code Quality & Tests

Object literal may only specify known properties, and 'allowedDevOrigins' does not exist in type 'ExperimentalConfig'.
},
};

export default nextConfig;
Loading
Loading