diff --git a/jest.config.js b/jest.config.js index 42a132d348..3fa3d9abd2 100644 --- a/jest.config.js +++ b/jest.config.js @@ -28,6 +28,7 @@ export default { '/scripts/__mocks__/@dicebear/collection.ts', '\\.svg\\?react$': '/scripts/__mocks__/fileMock.js', '\\.svg$': '/scripts/__mocks__/fileMock.js', + '^@pdfme/generator$': '/scripts/__mocks__/@pdfme/generator.ts' }, moduleFileExtensions: [ 'web.js', diff --git a/package-lock.json b/package-lock.json index 4e875229f7..876787bdb8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,7 +23,7 @@ "@mui/x-charts": "^7.22.1", "@mui/x-data-grid": "^7.22.1", "@mui/x-date-pickers": "^7.22.1", - "@pdfme/generator": "^4.5.2", + "@pdfme/generator": "^5.0.0", "@reduxjs/toolkit": "^2.3.0", "@vitejs/plugin-react": "^4.3.2", "babel-plugin-transform-import-meta": "^2.2.1", @@ -4170,9 +4170,9 @@ } }, "node_modules/@pdfme/generator": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/@pdfme/generator/-/generator-4.5.2.tgz", - "integrity": "sha512-lwvNnknTjAlmThkdxNJLcr/1/gYUW1H6xvtdX7t1OSQ/oEJfgcR9oFsUsR+OTnEYDN4zXkAmQbm1K/tnjNQWVA==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@pdfme/generator/-/generator-5.0.0.tgz", + "integrity": "sha512-Pb3HrjfPxqVcPAI2RpBx9NlthftoDqbE/5fwfMIrnx6ihNopazvYq0k4R4cEj/NIe38uJkwkXxpJeIlMS0vGcg==", "dependencies": { "@pdfme/pdf-lib": "^1.18.3", "atob": "^2.1.2", diff --git a/package.json b/package.json index f5ac37d35e..6c1e324953 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "@mui/x-charts": "^7.22.1", "@mui/x-data-grid": "^7.22.1", "@mui/x-date-pickers": "^7.22.1", - "@pdfme/generator": "^4.5.2", + "@pdfme/generator": "^5.0.0", "@reduxjs/toolkit": "^2.3.0", "@vitejs/plugin-react": "^4.3.2", "babel-plugin-transform-import-meta": "^2.2.1", diff --git a/scripts/__mocks__/@pdfme/generator.ts b/scripts/__mocks__/@pdfme/generator.ts new file mode 100644 index 0000000000..e184ca597e --- /dev/null +++ b/scripts/__mocks__/@pdfme/generator.ts @@ -0,0 +1,3 @@ +export const generate = async (): Promise => { + return new Uint8Array([10, 20, 30, 40, 50]); +};