Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v3.4.1 #195

Merged
merged 6 commits into from
Mar 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Removed
### BREAKING CHANGES

## [3.4.1] - 2022-03-02

### Fixed
- fix(#193): Do not log "Enabling skip mode" in every failed test. When a test fails, log "Failed tests: x/y", where `y` is the bail option.

### Changed
- chore(deps): Update devDependencies

## [3.4.0] - 2022-02-24

### Added
Expand Down
63 changes: 42 additions & 21 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cypress-fail-fast",
"version": "3.4.0",
"version": "3.4.1",
"description": "Skip the rest of Cypress tests on first failure",
"keywords": [
"cypress",
Expand Down Expand Up @@ -55,7 +55,7 @@
"eslint": "8.9.0",
"eslint-config-prettier": "8.4.0",
"eslint-plugin-prettier": "4.0.0",
"eslint-plugin-react": "7.28.0",
"eslint-plugin-react": "7.29.2",
"husky": "7.0.4",
"is-ci": "3.0.1",
"jest": "27.5.1",
Expand Down
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.4.0
sonar.projectVersion=3.4.1

sonar.javascript.file.suffixes=.js
sonar.sourceEncoding=UTF-8
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const RESET_FAILED_TESTS_TASK = "failFastResetFailedTests";

const STOP_MESSAGE = "Stopping Cypress runner due to a previous failure";
const SKIP_MESSAGE = "Enabling skip mode";
const FAILED_TEST_MESSAGE = "Enabling skip mode";
const FAILED_TEST_MESSAGE = "Failed tests";
const LOG_PREFIX = "[fail-fast]";

const ENVIRONMENT_DEFAULT_VALUES = {
Expand Down
5 changes: 3 additions & 2 deletions src/support.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ function support(Cypress, cy, beforeEach, afterEach, before) {
}

function registerFailureAndRunIfBailLimitIsReached(callback) {
cy.task(LOG_TASK, FAILED_TEST_MESSAGE);
cy.task(FAILED_TESTS_TASK, true, { log: false }).then((value) => {
if (value >= bailConfig(Cypress)) {
const bail = bailConfig(Cypress);
cy.task(LOG_TASK, `${FAILED_TEST_MESSAGE}: ${value}/${bail}`);
if (value >= bail) {
callback();
}
});
Expand Down
41 changes: 41 additions & 0 deletions test/support.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,47 @@ describe("support", () => {
failedTests: 2,
bail: 3,
});

describe("failed tests log", () => {
it("should log 1/1 when first test fails and bail is 1", async () => {
getSupportCallbacks({
failedTests: 1,
bail: 1,
testState: "failed",
testCurrentRetry: 3,
testRetries: 3,
});
afterEachCallback();
await wait(200);
expect(cy.task.calledWith("failFastLog", "Failed tests: 1/1")).toBe(true);
});

it("should log 1/2 when first test fails and bail is 2", async () => {
getSupportCallbacks({
failedTests: 1,
bail: 2,
testState: "failed",
testCurrentRetry: 3,
testRetries: 3,
});
afterEachCallback();
await wait(200);
expect(cy.task.calledWith("failFastLog", "Failed tests: 1/2")).toBe(true);
});

it("should log 3/4 when third test fails and bail is 4", async () => {
getSupportCallbacks({
failedTests: 3,
bail: 4,
testState: "failed",
testCurrentRetry: 3,
testRetries: 3,
});
afterEachCallback();
await wait(200);
expect(cy.task.calledWith("failFastLog", "Failed tests: 3/4")).toBe(true);
});
});
});
});
});