cypress-plugin-last-failed 2.0.7 → 2.0.8
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/cypress/e2e/tests.cy.js +17 -6
- package/package.json +1 -1
- package/runFailed.js +4 -2
- package/src/index.js +6 -2
package/cypress/e2e/tests.cy.js
CHANGED
|
@@ -11,12 +11,23 @@ describe('Should, run expected tests', () => {
|
|
|
11
11
|
expect(true).to.eq(true);
|
|
12
12
|
});
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
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 !== ''
|
|
37
|
-
|
|
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(
|
|
74
|
-
|
|
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;
|