Skip to content

Commit

Permalink
Merge pull request #168 from javierbrea/release
Browse files Browse the repository at this point in the history
Release v3.2.0
  • Loading branch information
javierbrea authored Nov 1, 2021
2 parents d079ba6 + 099ba69 commit 86044fd
Show file tree
Hide file tree
Showing 25 changed files with 2,103 additions and 2,009 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: ["12.22.1", "14.16.1", "15.14.0", "16.1.0"]
# NodeJS v17 still not supported in tests due to incompatibility with react-scripts
node: ["12.22.7", "14.16.1", "15.14.0", "16.13.0"]
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down Expand Up @@ -58,7 +59,7 @@ jobs:
- name: Download test results
uses: actions/download-artifact@v2
with:
name: coverage-16.1.0
name: coverage-16.13.0
path: coverage
- name: Coveralls
uses: coverallsapp/github-action@master
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-to-github-registry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
# Setup .npmrc file to publish to GitHub Packages
- uses: actions/setup-node@v2
with:
node-version: '14.x'
node-version: '16.x'
registry-url: 'https://npm.pkg.github.com'
# Defaults to the user or organization that owns the workflow file
scope: '@javierbrea'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-to-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14.x'
node-version: '16.x'
registry-url: 'https://registry.npmjs.org/'
- run: npm ci
- run: npm publish
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-mutation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
id: extract-branch
- uses: actions/setup-node@v2
with:
node-version: '14.x'
node-version: '16.x'
registry-url: 'https://registry.npmjs.org/'
- name: Cache node modules
uses: actions/cache@v2
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Removed
### BREAKING CHANGES

## [3.2.0] - 2021-11-01

### Changed
- chore(deps): Update devDependencies
- chore(deps): Support any NodeJs version greater than 10.x.

### Fixed
- fix(#124): Skip nested before hooks when one fails (#164)

## [3.1.1] - 2021-08-21

### Added
Expand Down
2,942 changes: 1,485 additions & 1,457 deletions package-lock.json

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cypress-fail-fast",
"version": "3.1.1",
"version": "3.2.0",
"description": "Skip the rest of Cypress tests on first failure",
"keywords": [
"cypress",
Expand Down Expand Up @@ -47,22 +47,22 @@
"chalk": "4.1.2"
},
"devDependencies": {
"@stryker-mutator/core": "5.3.0",
"@stryker-mutator/jest-runner": "5.3.0",
"@stryker-mutator/core": "5.4.1",
"@stryker-mutator/jest-runner": "5.4.1",
"babel-eslint": "10.1.0",
"cross-env": "7.0.3",
"cypress": "8.3.0",
"eslint": "7.32.0",
"cypress": "8.7.0",
"eslint": "8.1.0",
"eslint-config-prettier": "8.3.0",
"eslint-plugin-prettier": "3.4.0",
"eslint-plugin-react": "7.24.0",
"husky": "7.0.1",
"is-ci": "3.0.0",
"jest": "27.0.6",
"lint-staged": "11.1.2",
"eslint-plugin-prettier": "3.4.1",
"eslint-plugin-react": "7.25.1",
"husky": "7.0.4",
"is-ci": "3.0.1",
"jest": "27.3.1",
"lint-staged": "11.2.6",
"prettier": "2.3.2",
"sinon": "11.1.2",
"typescript": "4.3.5"
"typescript": "4.4.2"
},
"lint-staged": {
"*.js": "eslint",
Expand All @@ -74,6 +74,6 @@
"test-e2e/test/**/*.js": "eslint"
},
"engines": {
"node": "10.x || 12.x || 14.x || 15.x || 16.x"
"node": ">=10.0.0"
}
}
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
sonar.organization=javierbrea
sonar.projectKey=javierbrea_cypress-fail-fast
sonar.projectVersion=3.1.1
sonar.projectVersion=3.2.0

sonar.javascript.file.suffixes=.js
sonar.sourceEncoding=UTF-8
Expand Down
10 changes: 7 additions & 3 deletions src/support.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ function support(Cypress, cy, beforeEach, afterEach, before) {
const isBeforeHook = isHook && runnable.hookName.match(/before/);

const next = args[0];

const setFailedFlag = function (error) {
if (error) {
hookFailedName = runnable.hookName;
Expand All @@ -157,7 +158,7 @@ function support(Cypress, cy, beforeEach, afterEach, before) {
Do not pass the error, because Cypress stops if there is an error on before hooks,
so this plugin can't set the skip flag
*/
return next.call(/* this, error */);
return next.call(this /*, error */);
};

const forceTestToFail = function () {
Expand All @@ -167,10 +168,13 @@ function support(Cypress, cy, beforeEach, afterEach, before) {
return next.call(this, hookError);
};

if (isBeforeHook) {
args[0] = setFailedFlag;
if (isBeforeHook && hookFailed) {
// Skip other before hooks when one failed
return next();
} else if (!isHook && hookFailed) {
args[0] = forceTestToFail;
} else if (isBeforeHook) {
args[0] = setFailedFlag;
}

return _onRunnableRun.apply(this, [runnableRun, runnable, args]);
Expand Down
36 changes: 25 additions & 11 deletions test-e2e/cypress-src/integration/before-failing/a-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,33 @@ describe("List items", () => {
});
});

it("should display title", () => {
cy.get("h1").should("have.text", "Items list");
});
describe("List items tests", () => {
before(() => {
cy.task("log", "Executing second before hook").then(() => {
cy.visit("/");
});
});

it("should display first item", () => {
cy.get("ul li:eq(0)").should("have.text", "First item");
});
beforeEach(() => {
cy.task("log", "Executing beforeEach hook").then(() => {
cy.visit("/");
});
});

it("should display second item", () => {
cy.get("ul li:eq(1)").should("have.text", "Second item");
});
it("should display title", () => {
cy.get("h1").should("have.text", "Items list");
});

it("should display third item", () => {
cy.get("ul li:eq(2)").should("have.text", "Third item");
it("should display first item", () => {
cy.get("ul li:eq(0)").should("have.text", "First item");
});

it("should display second item", () => {
cy.get("ul li:eq(1)").should("have.text", "Second item");
});

it("should display third item", () => {
cy.get("ul li:eq(2)").should("have.text", "Third item");
});
});
});
6 changes: 3 additions & 3 deletions test-e2e/cypress-variants/cypress-5/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test-e2e/cypress-variants/cypress-5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"cypress": "5.6.0",
"cross-env": "7.0.3",
"fs-extra": "10.0.0",
"mochawesome": "6.2.2",
"mochawesome": "6.3.1",
"mochawesome-merge": "4.2.0",
"mochawesome-report-generator": "5.2.0"
}
Expand Down
20 changes: 10 additions & 10 deletions test-e2e/cypress-variants/cypress-6/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test-e2e/cypress-variants/cypress-6/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"cypress": "6.9.1",
"cross-env": "7.0.3",
"fs-extra": "10.0.0",
"mochawesome": "6.2.2",
"mochawesome": "6.3.1",
"mochawesome-merge": "4.2.0",
"mochawesome-report-generator": "5.2.0"
}
Expand Down
20 changes: 10 additions & 10 deletions test-e2e/cypress-variants/cypress-7/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test-e2e/cypress-variants/cypress-7/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"cypress": "7.5.0",
"cross-env": "7.0.3",
"fs-extra": "10.0.0",
"mochawesome": "6.2.2",
"mochawesome": "6.3.1",
"mochawesome-merge": "4.2.0",
"mochawesome-report-generator": "5.2.0"
}
Expand Down
Loading

0 comments on commit 86044fd

Please sign in to comment.