@centreon/js-config 25.2.2 → 25.3.0

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.
@@ -36,36 +36,27 @@ export default (
36
36
  });
37
37
 
38
38
  on('after:run', (results) => {
39
- const testRetries: { [key: string]: boolean } = {};
39
+ const testRetries: { [key: string]: Number } = {};
40
40
  if ('runs' in results) {
41
41
  results.runs.forEach((run) => {
42
42
  run.tests.forEach((test) => {
43
- if (test.attempts && test.attempts.length > 1) {
43
+ console.log(test)
44
+ if (test.attempts && test.attempts.length > 1 && test.state === 'passed') {
44
45
  const testTitle = test.title.join(' > '); // Convert the array to a string
45
- testRetries[testTitle] = true;
46
+ testRetries[testTitle] = test.attempts.length - 1;
46
47
  }
47
48
  });
48
49
  });
49
50
  }
50
51
 
51
- console.log('After run results:', results);
52
- console.log('Test retries:', testRetries);
53
-
54
52
  // Save the testRetries object to a file in the e2e/results directory
55
53
  const resultFilePath = path.join(
56
54
  __dirname,
57
55
  '../../../../tests/e2e/results',
58
- 'hasRetries.json'
56
+ 'retries.json'
59
57
  );
60
- if (results.totalFailed > 0) {
61
- fs.writeFileSync(resultFilePath, '{}');
62
- } else if (Object.keys(testRetries).length > 0) {
63
- // If tests succeeded but there were retries, write the retries to the file
64
- fs.writeFileSync(resultFilePath, JSON.stringify(testRetries, null, 2));
65
- } else {
66
- // If no retries, empty the file
67
- fs.writeFileSync(resultFilePath, '{}');
68
- }
58
+
59
+ fs.writeFileSync(resultFilePath, JSON.stringify(testRetries, null, 2));
69
60
  });
70
61
 
71
62
  return config;
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.2.2",
4
+ "version": "25.3.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/centreon/centreon-frontend.git"