@pdfme/generator 3.1.5-dev.16 → 3.1.5-dev.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/__tests__/integration1.test.js +7 -1
- package/dist/cjs/__tests__/integration1.test.js.map +1 -1
- package/dist/cjs/__tests__/integration2.test.js +7 -1
- package/dist/cjs/__tests__/integration2.test.js.map +1 -1
- package/dist/cjs/__tests__/integration3.test.js +7 -1
- package/dist/cjs/__tests__/integration3.test.js.map +1 -1
- package/dist/cjs/__tests__/integration4.test.js +7 -1
- package/dist/cjs/__tests__/integration4.test.js.map +1 -1
- package/dist/esm/__tests__/integration1.test.js +7 -1
- package/dist/esm/__tests__/integration1.test.js.map +1 -1
- package/dist/esm/__tests__/integration2.test.js +7 -1
- package/dist/esm/__tests__/integration2.test.js.map +1 -1
- package/dist/esm/__tests__/integration3.test.js +7 -1
- package/dist/esm/__tests__/integration3.test.js.map +1 -1
- package/dist/esm/__tests__/integration4.test.js +7 -1
- package/dist/esm/__tests__/integration4.test.js.map +1 -1
- package/package.json +1 -1
@@ -8,6 +8,7 @@ const generate_1 = __importDefault(require("../src/generate"));
|
|
8
8
|
const templates_1 = require("./assets/templates");
|
9
9
|
const schemas_1 = require("@pdfme/schemas");
|
10
10
|
const utils_1 = require("./utils");
|
11
|
+
const PERFORMANCE_THRESHOLD = parseFloat(process.env.PERFORMANCE_THRESHOLD || '1.5');
|
11
12
|
describe('generate integration test(label, envelope)', () => {
|
12
13
|
describe.each([templates_1.label, templates_1.envelope])('%s', (templateData) => {
|
13
14
|
const entries = Object.entries(templateData);
|
@@ -31,7 +32,12 @@ describe('generate integration test(label, envelope)', () => {
|
|
31
32
|
});
|
32
33
|
const hrend = process.hrtime(hrstart);
|
33
34
|
const execSeconds = hrend[0] + hrend[1] / 1000000000;
|
34
|
-
|
35
|
+
if (process.env.CI) {
|
36
|
+
expect(execSeconds).toBeLessThan(PERFORMANCE_THRESHOLD);
|
37
|
+
}
|
38
|
+
else if (execSeconds >= PERFORMANCE_THRESHOLD) {
|
39
|
+
console.warn(`Warning: Execution time for ${key} is ${execSeconds} seconds, which is above the threshold of ${PERFORMANCE_THRESHOLD} seconds.`);
|
40
|
+
}
|
35
41
|
const tmpFile = (0, utils_1.getPdfTmpPath)(`${key}.pdf`);
|
36
42
|
const assertFile = (0, utils_1.getPdfAssertPath)(`${key}.pdf`);
|
37
43
|
(0, fs_1.writeFileSync)(tmpFile, pdf);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"integration1.test.js","sourceRoot":"","sources":["../../../__tests__/integration1.test.ts"],"names":[],"mappings":";;;;;AAAA,2BAAmC;AACnC,+DAAuC;AACvC,kDAAqD;AACrD,4CAA6C;AAC7C,mCAA2E;AAE3E,QAAQ,CAAC,4CAA4C,EAAE,GAAG,EAAE;IAC1D,QAAQ,CAAC,IAAI,CAAC,CAAC,iBAAK,EAAE,oBAAQ,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,YAAY,EAAE,EAAE;QACtD,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;QAC7C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;YAC1C,MAAM,CAAC,GAAG,EAAE,QAAQ,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;YAEnC,wCAAwC;YACxC,IAAI,CAAC,YAAY,GAAG,EAAE,EAAE,KAAK,IAAI,EAAE;gBACjC,MAAM,MAAM,GAAG,QAAQ,CAAC,UAAW,CAAC;gBAEpC,MAAM,IAAI,GAAG,IAAA,eAAO,GAAE,CAAC;gBACvB,IAAI,CAAC,cAAc,CAAC,QAAQ,GAAG,KAAK,CAAC;gBACrC,IAAI,CAAC,eAAe,CAAC,QAAQ,GAAG,KAAK,CAAC;gBACtC,IAAI,CAAC,qBAAqB,CAAC,CAAC,QAAQ,GA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AAG,MAAM,CAAC,CAAC;gBAC5C,MAAM,UAAU,GAAG,IAAA,wBAAgB,EAAC,GAAG,GAAG,MAAM,CAAC,CAAC;gBAElD,IAAA,kBAAa,EAAC,OAAO,EAAE,GAAG,CAAC,CAAC;gBAC5B,MAAM,GAAG,GAAQ,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,IAAA,cAAM,EAAC,OAAO,CAAC,EAAE,IAAA,cAAM,EAAC,UAAU,CAAC,CAAC,CAAC,CAAC;gBAC1E,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC;gBACnB,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YACnC,CAAC,CAAC,CAAC;SACJ;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
@@ -8,6 +8,7 @@ const generate_1 = __importDefault(require("../src/generate"));
|
|
8
8
|
const templates_1 = require("./assets/templates");
|
9
9
|
const schemas_1 = require("@pdfme/schemas");
|
10
10
|
const utils_1 = require("./utils");
|
11
|
+
const PERFORMANCE_THRESHOLD = parseFloat(process.env.PERFORMANCE_THRESHOLD || '2.0');
|
11
12
|
describe('generate integration test(barcode, business)', () => {
|
12
13
|
describe.each([templates_1.barcode, templates_1.business])('%s', (templateData) => {
|
13
14
|
const entries = Object.entries(templateData);
|
@@ -31,7 +32,12 @@ describe('generate integration test(barcode, business)', () => {
|
|
31
32
|
});
|
32
33
|
const hrend = process.hrtime(hrstart);
|
33
34
|
const execSeconds = hrend[0] + hrend[1] / 1000000000;
|
34
|
-
|
35
|
+
if (process.env.CI) {
|
36
|
+
expect(execSeconds).toBeLessThan(PERFORMANCE_THRESHOLD);
|
37
|
+
}
|
38
|
+
else if (execSeconds >= PERFORMANCE_THRESHOLD) {
|
39
|
+
console.warn(`Warning: Execution time for ${key} is ${execSeconds} seconds, which is above the threshold of ${PERFORMANCE_THRESHOLD} seconds.`);
|
40
|
+
}
|
35
41
|
const tmpFile = (0, utils_1.getPdfTmpPath)(`${key}.pdf`);
|
36
42
|
const assertFile = (0, utils_1.getPdfAssertPath)(`${key}.pdf`);
|
37
43
|
(0, fs_1.writeFileSync)(tmpFile, pdf);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"integration2.test.js","sourceRoot":"","sources":["../../../__tests__/integration2.test.ts"],"names":[],"mappings":";;;;;AAAA,2BAAmC;AACnC,+DAAuC;AACvC,kDAAuD;AACvD,4CAAuD;AACvD,mCAA2E;AAE3E,QAAQ,CAAC,8CAA8C,EAAE,GAAG,EAAE;IAC5D,QAAQ,CAAC,IAAI,CAAC,CAAC,mBAAO,EAAE,oBAAQ,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,YAAY,EAAE,EAAE;QACxD,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;QAC7C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;YAC1C,MAAM,CAAC,GAAG,EAAE,QAAQ,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;YAEnC,wCAAwC;YACxC,IAAI,CAAC,YAAY,GAAG,EAAE,EAAE,KAAK,IAAI,EAAE;gBACjC,MAAM,MAAM,GAAG,QAAQ,CAAC,UAAW,CAAC;gBAEpC,MAAM,IAAI,GAAG,IAAA,eAAO,GAAE,CAAC;gBACvB,IAAI,CAAC,cAAc,CAAC,QAAQ,GAAG,KAAK,CAAC;gBACrC,IAAI,CAAC,eAAe,CAAC,QAAQ,GAAG,KAAK,CAAC;gBACtC,IAAI,CAAC,qBAAqB,CAAC,CAAC,QAAQ,GAAG,KAAK,CAAC;gBAC7C,aAAa;gBACb,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,QAAQ,GAAG,IAAI,CAAC;gBAExC,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM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AAA,kBAAa,EAAC,OAAO,EAAE,GAAG,CAAC,CAAC;gBAC5B,MAAM,GAAG,GAAQ,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,IAAA,cAAM,EAAC,OAAO,CAAC,EAAE,IAAA,cAAM,EAAC,UAAU,CAAC,CAAC,CAAC,CAAC;gBAC1E,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC;gBACnB,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YACnC,CAAC,CAAC,CAAC;SACJ;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
@@ -19,6 +19,7 @@ const signature = {
|
|
19
19
|
},
|
20
20
|
},
|
21
21
|
};
|
22
|
+
const PERFORMANCE_THRESHOLD = parseFloat(process.env.PERFORMANCE_THRESHOLD || '1.5');
|
22
23
|
describe('generate integration test(other, shape)', () => {
|
23
24
|
describe.each([templates_1.other, templates_1.shape])('%s', (templateData) => {
|
24
25
|
const entries = Object.entries(templateData);
|
@@ -52,7 +53,12 @@ describe('generate integration test(other, shape)', () => {
|
|
52
53
|
});
|
53
54
|
const hrend = process.hrtime(hrstart);
|
54
55
|
const execSeconds = hrend[0] + hrend[1] / 1000000000;
|
55
|
-
|
56
|
+
if (process.env.CI) {
|
57
|
+
expect(execSeconds).toBeLessThan(PERFORMANCE_THRESHOLD);
|
58
|
+
}
|
59
|
+
else if (execSeconds >= PERFORMANCE_THRESHOLD) {
|
60
|
+
console.warn(`Warning: Execution time for ${key} is ${execSeconds} seconds, which is above the threshold of ${PERFORMANCE_THRESHOLD} seconds.`);
|
61
|
+
}
|
56
62
|
const tmpFile = (0, utils_1.getPdfTmpPath)(`${key}.pdf`);
|
57
63
|
const assertFile = (0, utils_1.getPdfAssertPath)(`${key}.pdf`);
|
58
64
|
(0, fs_1.writeFileSync)(tmpFile, pdf);
|
@@ -1 +1 @@
|
|
1
|
-
{"version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EAAE,EAAE,IAAI,EAAE;iBAClB,CAAC,CAAC;gBAEH,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;gBACtC,MAAM,WAAW,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC;gBACrD,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE;oBAClB,MAAM,CAAC,WAAW,CAAC,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAC;iBACzD;qBAAM,IAAI,WAAW,IAAI,qBAAqB,EAAE;oBAC/C,OAAO,CAAC,IAAI,CAAC,+BAA+B,GAAG,OAAO,WAAW,6CAA6C,qBAAqB,WAAW,CAAC,CAAC;iBACjJ;gBAED,MAAM,OAAO,GAAG,IAAA,qBAAa,EAAC,GAAG,GAAG,MAAM,CAAC,CAAC;gBAC5C,MAAM,UAAU,GAAG,IAAA,wBAAgB,EAAC,GAAG,GAAG,MAAM,CAAC,CAAC;gBAElD,IAAA,kBAAa,EAAC,OAAO,EAAE,GAAG,CAAC,CAAC;gBAC5B,MAAM,GAAG,GAAQ,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,IAAA,cAAM,EAAC,OAAO,CAAC,EAAE,IAAA,cAAM,EAAC,UAAU,CAAC,CAAC,CAAC,CAAC;gBAC1E,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC;gBACnB,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YACnC,CAAC,CAAC,CAAC;SACJ;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
@@ -8,6 +8,7 @@ const generate_1 = __importDefault(require("../src/generate"));
|
|
8
8
|
const templates_1 = require("./assets/templates");
|
9
9
|
const schemas_1 = require("@pdfme/schemas");
|
10
10
|
const utils_1 = require("./utils");
|
11
|
+
const PERFORMANCE_THRESHOLD = parseFloat(process.env.PERFORMANCE_THRESHOLD || '2.5');
|
11
12
|
describe('generate integration test(slower)', () => {
|
12
13
|
describe.each([templates_1.textType])('%s', (templateData) => {
|
13
14
|
const entries = Object.entries(templateData);
|
@@ -31,7 +32,12 @@ describe('generate integration test(slower)', () => {
|
|
31
32
|
});
|
32
33
|
const hrend = process.hrtime(hrstart);
|
33
34
|
const execSeconds = hrend[0] + hrend[1] / 1000000000;
|
34
|
-
|
35
|
+
if (process.env.CI) {
|
36
|
+
expect(execSeconds).toBeLessThan(PERFORMANCE_THRESHOLD);
|
37
|
+
}
|
38
|
+
else if (execSeconds >= PERFORMANCE_THRESHOLD) {
|
39
|
+
console.warn(`Warning: Execution time for ${key} is ${execSeconds} seconds, which is above the threshold of ${PERFORMANCE_THRESHOLD} seconds.`);
|
40
|
+
}
|
35
41
|
const tmpFile = (0, utils_1.getPdfTmpPath)(`${key}.pdf`);
|
36
42
|
const assertFile = (0, utils_1.getPdfAssertPath)(`${key}.pdf`);
|
37
43
|
(0, fs_1.writeFileSync)(tmpFile, pdf);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"integration4.test.js","sourceRoot":"","sources":["../../../__tests__/integration4.test.ts"],"names":[],"mappings":";;;;;AAAA,2BAAmC;AACnC,+DAAuC;AACvC,kDAA8C;AAC9C,4CAAuD;AACvD,mCAA2E;AAE3E,QAAQ,CAAC,mCAAmC,EAAE,GAAG,EAAE;IACjD,QAAQ,CAAC,IAAI,CAAC,CAAC,oBAAQ,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,YAAY,EAAE,EAAE;QAC/C,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;QAC7C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;YAC1C,MAAM,CAAC,GAAG,EAAE,QAAQ,CAAC,GAAG,OAAO,CAAC,CAAC,C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AAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC;gBACrD,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE;oBAClB,MAAM,CAAC,WAAW,CAAC,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAC;iBACzD;qBAAM,IAAI,WAAW,IAAI,qBAAqB,EAAE;oBAC/C,OAAO,CAAC,IAAI,CAAC,+BAA+B,GAAG,OAAO,WAAW,6CAA6C,qBAAqB,WAAW,CAAC,CAAC;iBACjJ;gBAED,MAAM,OAAO,GAAG,IAAA,qBAAa,EAAC,GAAG,GAAG,MAAM,CAAC,CAAC;gBAC5C,MAAM,UAAU,GAAG,IAAA,wBAAgB,EAAC,GAAG,GAAG,MAAM,CAAC,CAAC;gBAElD,IAAA,kBAAa,EAAC,OAAO,EAAE,GAAG,CAAC,CAAC;gBAC5B,MAAM,GAAG,GAAQ,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,IAAA,cAAM,EAAC,OAAO,CAAC,EAAE,IAAA,cAAM,EAAC,UAAU,CAAC,CAAC,CAAC,CAAC;gBAC1E,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC;gBACnB,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YACnC,CAAC,CAAC,CAAC;SACJ;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
@@ -3,6 +3,7 @@ import generate from '../src/generate';
|
|
3
3
|
import { label, envelope } from './assets/templates';
|
4
4
|
import { text, image } from '@pdfme/schemas';
|
5
5
|
import { getFont, getPdf, getPdfTmpPath, getPdfAssertPath } from './utils';
|
6
|
+
const PERFORMANCE_THRESHOLD = parseFloat(process.env.PERFORMANCE_THRESHOLD || '1.5');
|
6
7
|
describe('generate integration test(label, envelope)', () => {
|
7
8
|
describe.each([label, envelope])('%s', (templateData) => {
|
8
9
|
const entries = Object.entries(templateData);
|
@@ -26,7 +27,12 @@ describe('generate integration test(label, envelope)', () => {
|
|
26
27
|
});
|
27
28
|
const hrend = process.hrtime(hrstart);
|
28
29
|
const execSeconds = hrend[0] + hrend[1] / 1000000000;
|
29
|
-
|
30
|
+
if (process.env.CI) {
|
31
|
+
expect(execSeconds).toBeLessThan(PERFORMANCE_THRESHOLD);
|
32
|
+
}
|
33
|
+
else if (execSeconds >= PERFORMANCE_THRESHOLD) {
|
34
|
+
console.warn(`Warning: Execution time for ${key} is ${execSeconds} seconds, which is above the threshold of ${PERFORMANCE_THRESHOLD} seconds.`);
|
35
|
+
}
|
30
36
|
const tmpFile = getPdfTmpPath(`${key}.pdf`);
|
31
37
|
const assertFile = getPdfAssertPath(`${key}.pdf`);
|
32
38
|
writeFileSync(tmpFile, pdf);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"integration1.test.js","sourceRoot":"","sources":["../../../__tests__/integration1.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AACnC,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3E,QAAQ,CAAC,4CAA4C,EAAE,GAAG,EAAE;IAC1D,QAAQ,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,YAAY,EAAE,EAAE;QACtD,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;QAC7C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;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IAAI,EAAE,KAAK,EAAE;oBACxB,OAAO,EAAE,EAAE,IAAI,EAAE;iBAClB,CAAC,CAAC;gBAEH,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;gBACtC,MAAM,WAAW,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC;gBACrD,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE;oBAClB,MAAM,CAAC,WAAW,CAAC,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAC;iBACzD;qBAAM,IAAI,WAAW,IAAI,qBAAqB,EAAE;oBAC/C,OAAO,CAAC,IAAI,CAAC,+BAA+B,GAAG,OAAO,WAAW,6CAA6C,qBAAqB,WAAW,CAAC,CAAC;iBACjJ;gBAED,MAAM,OAAO,GAAG,aAAa,CAAC,GAAG,GAAG,MAAM,CAAC,CAAC;gBAC5C,MAAM,UAAU,GAAG,gBAAgB,CAAC,GAAG,GAAG,MAAM,CAAC,CAAC;gBAElD,aAAa,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;gBAC5B,MAAM,GAAG,GAAQ,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;gBAC1E,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC;gBACnB,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YACnC,CAAC,CAAC,CAAC;SACJ;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
@@ -3,6 +3,7 @@ import generate from '../src/generate';
|
|
3
3
|
import { barcode, business } from './assets/templates';
|
4
4
|
import { text, image, barcodes } from '@pdfme/schemas';
|
5
5
|
import { getFont, getPdf, getPdfTmpPath, getPdfAssertPath } from './utils';
|
6
|
+
const PERFORMANCE_THRESHOLD = parseFloat(process.env.PERFORMANCE_THRESHOLD || '2.0');
|
6
7
|
describe('generate integration test(barcode, business)', () => {
|
7
8
|
describe.each([barcode, business])('%s', (templateData) => {
|
8
9
|
const entries = Object.entries(templateData);
|
@@ -26,7 +27,12 @@ describe('generate integration test(barcode, business)', () => {
|
|
26
27
|
});
|
27
28
|
const hrend = process.hrtime(hrstart);
|
28
29
|
const execSeconds = hrend[0] + hrend[1] / 1000000000;
|
29
|
-
|
30
|
+
if (process.env.CI) {
|
31
|
+
expect(execSeconds).toBeLessThan(PERFORMANCE_THRESHOLD);
|
32
|
+
}
|
33
|
+
else if (execSeconds >= PERFORMANCE_THRESHOLD) {
|
34
|
+
console.warn(`Warning: Execution time for ${key} is ${execSeconds} seconds, which is above the threshold of ${PERFORMANCE_THRESHOLD} seconds.`);
|
35
|
+
}
|
30
36
|
const tmpFile = getPdfTmpPath(`${key}.pdf`);
|
31
37
|
const assertFile = getPdfAssertPath(`${key}.pdf`);
|
32
38
|
writeFileSync(tmpFile, pdf);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"integration2.test.js","sourceRoot":"","sources":["../../../__tests__/integration2.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AACnC,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3E,QAAQ,CAAC,8CAA8C,EAAE,GAAG,EAAE;IAC5D,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,YAAY,EAAE,EAA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AAC;SACJ;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
@@ -14,6 +14,7 @@ const signature = {
|
|
14
14
|
},
|
15
15
|
},
|
16
16
|
};
|
17
|
+
const PERFORMANCE_THRESHOLD = parseFloat(process.env.PERFORMANCE_THRESHOLD || '1.5');
|
17
18
|
describe('generate integration test(other, shape)', () => {
|
18
19
|
describe.each([other, shape])('%s', (templateData) => {
|
19
20
|
const entries = Object.entries(templateData);
|
@@ -47,7 +48,12 @@ describe('generate integration test(other, shape)', () => {
|
|
47
48
|
});
|
48
49
|
const hrend = process.hrtime(hrstart);
|
49
50
|
const execSeconds = hrend[0] + hrend[1] / 1000000000;
|
50
|
-
|
51
|
+
if (process.env.CI) {
|
52
|
+
expect(execSeconds).toBeLessThan(PERFORMANCE_THRESHOLD);
|
53
|
+
}
|
54
|
+
else if (execSeconds >= PERFORMANCE_THRESHOLD) {
|
55
|
+
console.warn(`Warning: Execution time for ${key} is ${execSeconds} seconds, which is above the threshold of ${PERFORMANCE_THRESHOLD} seconds.`);
|
56
|
+
}
|
51
57
|
const tmpFile = getPdfTmpPath(`${key}.pdf`);
|
52
58
|
const assertFile = getPdfAssertPath(`${key}.pdf`);
|
53
59
|
writeFileSync(tmpFile, pdf);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"integration3.test.js","sourceRoot":"","sources":["../../../__tests__/integration3.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AACnC,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EACL,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,SAAS,EACT,OAAO,EACP,YAAY,EACZ,QAAQ,EACR,WAAW,GACZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,gBAAgB,EA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MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;gBACtC,MAAM,WAAW,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC;gBACrD,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE;oBAClB,MAAM,CAAC,WAAW,CAAC,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAC;iBACzD;qBAAM,IAAI,WAAW,IAAI,qBAAqB,EAAE;oBAC/C,OAAO,CAAC,IAAI,CAAC,+BAA+B,GAAG,OAAO,WAAW,6CAA6C,qBAAqB,WAAW,CAAC,CAAC;iBACjJ;gBAED,MAAM,OAAO,GAAG,aAAa,CAAC,GAAG,GAAG,MAAM,CAAC,CAAC;gBAC5C,MAAM,UAAU,GAAG,gBAAgB,CAAC,GAAG,GAAG,MAAM,CAAC,CAAC;gBAElD,aAAa,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;gBAC5B,MAAM,GAAG,GAAQ,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;gBAC1E,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC;gBACnB,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YACnC,CAAC,CAAC,CAAC;SACJ;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
@@ -3,6 +3,7 @@ import generate from '../src/generate';
|
|
3
3
|
import { textType } from './assets/templates';
|
4
4
|
import { text, image, barcodes } from '@pdfme/schemas';
|
5
5
|
import { getFont, getPdf, getPdfTmpPath, getPdfAssertPath } from './utils';
|
6
|
+
const PERFORMANCE_THRESHOLD = parseFloat(process.env.PERFORMANCE_THRESHOLD || '2.5');
|
6
7
|
describe('generate integration test(slower)', () => {
|
7
8
|
describe.each([textType])('%s', (templateData) => {
|
8
9
|
const entries = Object.entries(templateData);
|
@@ -26,7 +27,12 @@ describe('generate integration test(slower)', () => {
|
|
26
27
|
});
|
27
28
|
const hrend = process.hrtime(hrstart);
|
28
29
|
const execSeconds = hrend[0] + hrend[1] / 1000000000;
|
29
|
-
|
30
|
+
if (process.env.CI) {
|
31
|
+
expect(execSeconds).toBeLessThan(PERFORMANCE_THRESHOLD);
|
32
|
+
}
|
33
|
+
else if (execSeconds >= PERFORMANCE_THRESHOLD) {
|
34
|
+
console.warn(`Warning: Execution time for ${key} is ${execSeconds} seconds, which is above the threshold of ${PERFORMANCE_THRESHOLD} seconds.`);
|
35
|
+
}
|
30
36
|
const tmpFile = getPdfTmpPath(`${key}.pdf`);
|
31
37
|
const assertFile = getPdfAssertPath(`${key}.pdf`);
|
32
38
|
writeFileSync(tmpFile, pdf);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"integration4.test.js","sourceRoot":"","sources":["../../../__tests__/integration4.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AACnC,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3E,QAAQ,CAAC,mCAAmC,EAAE,GAAG,EAAE;IACjD,QAAQ,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,YAAY,EAAE,EAAE;QAC/C,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;QAC7C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,O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