cypress-plugin-last-failed 2.0.7 → 2.0.9

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.
@@ -11,12 +11,23 @@ describe('Should, run expected tests', () => {
11
11
  expect(true).to.eq(true);
12
12
  });
13
13
 
14
- it('needs to run', () => {
15
- if (Cypress.env('shouldPass')) {
16
- expect(1).to.eq(1);
17
- } else {
18
- expect(1).to.eq(2);
19
- }
14
+ describe('Inner suite, 1', () => {
15
+ it('needs to run', () => {
16
+ if (Cypress.env('shouldPass')) {
17
+ expect(1).to.eq(1);
18
+ } else {
19
+ expect(1).to.eq(2);
20
+ }
21
+ });
22
+ describe('Inner suite, 2', () => {
23
+ it('needs to run', () => {
24
+ if (Cypress.env('shouldPass')) {
25
+ expect(1).to.eq(1);
26
+ } else {
27
+ expect(1).to.eq(2);
28
+ }
29
+ });
30
+ });
20
31
  });
21
32
 
22
33
  it('will, be included in failed tests', () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cypress-plugin-last-failed",
3
- "version": "2.0.7",
3
+ "version": "2.0.9",
4
4
  "description": "Cypress plugin to rerun last failed tests in cypress run and open mode",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
package/runFailed.js CHANGED
@@ -28,13 +28,15 @@ Try running tests again with cypress run`;
28
28
  parent,
29
29
  test,
30
30
  }));
31
+
31
32
  // Combine parent suite and test together
32
33
  // If parent title is empty do not add space before test title
33
34
  const resultSet = new Set(
34
35
  Object.values(parentAndTest).flatMap(
35
36
  (parent) =>
36
- (parent.parent !== '' ? parent.parent + ' ' : parent.parent) +
37
- parent.test
37
+ (parent.parent !== ''
38
+ ? parent.parent.join(' ') + ' '
39
+ : parent.parent) + parent.test
38
40
  )
39
41
  );
40
42
 
package/src/index.js CHANGED
@@ -70,8 +70,12 @@ const generateReports = (tests, spec, config) => {
70
70
  if (config.env.burn) {
71
71
  const seen = new Set();
72
72
  const filteredReports = reports.filter((el) => {
73
- const duplicate = seen.has(el.test);
74
- seen.add(el.test);
73
+ const duplicate = seen.has(
74
+ (el.parent !== '' ? el.parent.join(' ') + ' ' : el.parent) + el.test
75
+ );
76
+ seen.add(
77
+ (el.parent !== '' ? el.parent.join(' ') + ' ' : el.parent) + el.test
78
+ );
75
79
  return !duplicate;
76
80
  });
77
81
  return filteredReports;