cypress-plugin-last-failed 2.0.5 โ†’ 2.0.6

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.
@@ -26,6 +26,31 @@ jobs:
26
26
  # environment variable used for CI/CD tests in this repo
27
27
  command: npx cypress-plugin-last-failed run --env shouldPass=true
28
28
  working-directory: ${{ github.workspace }}
29
+ exit-code-check:
30
+ runs-on: ubuntu-22.04
31
+ steps:
32
+ - name: Checkout ๐Ÿ“ฆ
33
+ uses: actions/checkout@v4
34
+ - name: Cypress run ๐Ÿ‘Ÿ
35
+ uses: cypress-io/github-action@v6
36
+ continue-on-error: true
37
+ - name: Output the file contents ๐Ÿ“
38
+ if: always()
39
+ run: |
40
+ cat ./test-results/last-run.json
41
+ - name: Run failed tests from default directory ๐Ÿงช
42
+ id: run-failed
43
+ if: always()
44
+ continue-on-error: true
45
+ run: |
46
+ set +e
47
+ npx cypress-plugin-last-failed run
48
+ exitcode="$?"
49
+ echo "exitcode=$exitcode" >> $GITHUB_OUTPUT
50
+ - name: Output the runFailed node script exit code ๐Ÿ“
51
+ if: always()
52
+ run: |
53
+ echo ${{ steps.run-failed.outputs.exitcode }}
29
54
  burn-test-results:
30
55
  runs-on: ubuntu-22.04
31
56
  steps:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cypress-plugin-last-failed",
3
- "version": "2.0.5",
3
+ "version": "2.0.6",
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
@@ -51,7 +51,15 @@ Try running tests again with cypress run`;
51
51
  process.env.CYPRESS_grepFilterSpecs = true;
52
52
  process.env.CYPRESS_grepOmitFiltered = true;
53
53
 
54
- await cypress.run(runOptions);
54
+ await cypress
55
+ .run(runOptions)
56
+ .then((results) => {
57
+ process.exit(results.totalFailed);
58
+ })
59
+ .catch((err) => {
60
+ console.error(err);
61
+ process.exit(1);
62
+ });
55
63
  } else {
56
64
  console.log(noFailedTestsMessage);
57
65
  }