Skip to content

Commit

Permalink
Force to set the shouldSkip flag to true when a before hook fails…
Browse files Browse the repository at this point in the history
… in Cypress 13 (#297) (#298)

### Fixed

- fix(#296): Force to set the `shouldSkip` flag to `true` when a before hook fails in Cypress 13.

### Changed
- docs(#295): Change installation example to ES6 import syntax
- chore(deps): Update devDependencies
  • Loading branch information
javierbrea authored Aug 5, 2024
1 parent d96250b commit 0c88df3
Show file tree
Hide file tree
Showing 30 changed files with 5,174 additions and 3,981 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ jobs:
strategy:
max-parallel: 2
matrix:
node: ["16.14.0", "18.2.0", "20.5.1"]
node: ["18.20.2", "20.13.1", "22.2.0"]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Cache node modules
uses: actions/cache@v3
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
Expand All @@ -46,7 +46,7 @@ jobs:
run: npm run test:e2e:ci
id: test-e2e
- name: Upload test results
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.node }}
path: coverage
Expand All @@ -56,13 +56,13 @@ jobs:
needs: test
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download test results
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: coverage-18.2.0
name: coverage-20.13.1
path: coverage
- name: Coveralls
uses: coverallsapp/github-action@master
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/check-package-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Get NPM version is new
id: check
uses: EndBug/[email protected].1
uses: EndBug/[email protected].4
with:
diff-search: true
file-name: ./package.json
Expand All @@ -27,10 +27,10 @@ jobs:
exit 1
- name: Get NPM version
id: package-version
uses: martinbeentjes/npm-get-version-action@v1.2.3
uses: martinbeentjes/npm-get-version-action@v1.3.1
- name: Check Changelog version
id: changelog_reader
uses: mindsers/[email protected].2
uses: mindsers/[email protected].3
with:
version: ${{ steps.package-version.outputs.current-version }}
path: ./CHANGELOG.md
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish-to-github-registry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: npm ci
# Setup .npmrc file to publish to GitHub Packages
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: '18.x'
node-version: '22.x'
registry-url: 'https://npm.pkg.github.com'
# Defaults to the user or organization that owns the workflow file
scope: '@javierbrea'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish-to-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18.x'
node-version: '22.x'
registry-url: 'https://registry.npmjs.org/'
- run: npm ci
- run: npm publish
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test-mutation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ jobs:
test-mutation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF##*/})"
id: extract-branch
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: '18.x'
node-version: '22.x'
registry-url: 'https://registry.npmjs.org/'
- name: Cache node modules
uses: actions/cache@v3
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Removed
### BREAKING CHANGES

## [7.1.1] - 2024-08-04

### Fixed

- fix(#296): Force to set the `shouldSkip` flag to `true` when a before hook fails in Cypress 13.

### Changed
- docs(#295): Change installation example to ES6 import syntax
- chore(deps): Update devDependencies

## [7.1.0] - 2023-11-21

### Added
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 Javier Brea
Copyright (c) 2020-2024 Javier Brea

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,26 @@ npm i --save-dev cypress-fail-fast

Now, depending on your Cypress version, use one of the next methods:

### Installation on Cypress 10
### Installation on Cypress 10 and higher

Inside `cypress.config.js` file:
Inside `cypress.config.ts` file:

```javascript
module.exports = {
import cypressFailFast from "cypress-fail-fast/plugin";

export default defineConfig({
e2e: {
setupNodeEvents(on, config) {
require("cypress-fail-fast/plugin")(on, config);
return config;
cypressFailFast(on, config);
},
specPattern: "cypress/integration/**/*.js",
},
};
});
```

In case you are using JavaScript, you may explicit the file extension in some cases:

```javascript
import cypressFailFast from "cypress-fail-fast/plugin.js"
```

Note: This example shows how to install the plugin for `e2e` testing type. Read [Cypress configuration docs](https://docs.cypress.io/guides/references/configuration) for further info.
Expand Down
Loading

0 comments on commit 0c88df3

Please sign in to comment.