@centreon/js-config 25.10.2-dev-25-10-x.0 → 25.10.3

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.
@@ -6,6 +6,9 @@ const {
6
6
  } = require('@simonsmith/cypress-image-snapshot/plugin');
7
7
  const cypressCodeCoverageTask = require('@cypress/code-coverage/task');
8
8
 
9
+ const fs = require('fs');
10
+ const path = require('path');
11
+
9
12
  module.exports = ({
10
13
  rspackConfig,
11
14
  cypressFolder,
@@ -41,6 +44,35 @@ module.exports = ({
41
44
 
42
45
  return launchOptions;
43
46
  });
47
+
48
+ on('after:run', (results) => {
49
+ const testRetries = {};
50
+ if ('runs' in results) {
51
+ results.runs.forEach((run) => {
52
+ run.tests.forEach((test) => {
53
+ if (test.attempts && test.attempts.length > 1 && test.state === 'passed') {
54
+ const testTitle = test.title.join(' > '); // Convert the array to a string
55
+ testRetries[testTitle] = test.attempts.length - 1;
56
+ }
57
+ });
58
+ });
59
+ }
60
+
61
+ // Save the testRetries object to a file in the e2e/results directory
62
+ const resultFilePath = path.join(
63
+ mainCypressFolder,
64
+ 'results',
65
+ 'retries.json'
66
+ );
67
+
68
+ fs.writeFileSync(resultFilePath, JSON.stringify(testRetries, null, 2));
69
+ });
70
+
71
+ on('after:spec', () => {
72
+ if (global.__coverage__) {
73
+ delete global.__coverage__;
74
+ }
75
+ });
44
76
  },
45
77
  specPattern,
46
78
  supportFile: `${mainCypressFolder}/support/component.tsx`
@@ -58,6 +90,7 @@ module.exports = ({
58
90
  },
59
91
  ...env
60
92
  },
93
+ numTestsKeptInMemory: 1,
61
94
  reporter: 'mochawesome',
62
95
  reporterOptions: {
63
96
  html: false,
@@ -66,6 +99,10 @@ module.exports = ({
66
99
  reportDir: `${mainCypressFolder}/results`,
67
100
  reportFilename: '[name]-report.json'
68
101
  },
102
+ retries: {
103
+ openMode: 0,
104
+ runMode: 2
105
+ },
69
106
  video: true,
70
107
  videosFolder: `${mainCypressFolder}/results/videos`,
71
108
  viewportHeight: 590,
@@ -54,6 +54,12 @@ export default ({
54
54
  commandTrimLength: 5000,
55
55
  defaultTrimLength: 5000,
56
56
  });
57
+ on("task", {
58
+ logVersion(message) {
59
+ console.log(`[LOG]: ${message}`);
60
+ return null;
61
+ },
62
+ });
57
63
  await esbuildPreprocessor(on, config);
58
64
  tasks(on);
59
65
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@centreon/js-config",
3
3
  "description": "Centreon Frontend shared build configuration",
4
- "version": "25.10.2-dev-25-10-x.0",
4
+ "version": "25.10.3",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/centreon/centreon-frontend.git"