Skip to content
This repository has been archived by the owner on Sep 19, 2024. It is now read-only.

Commit

Permalink
Merge pull request #15 from foretagsplatsen/release-3.1.1
Browse files Browse the repository at this point in the history
Release 3.1.1
  • Loading branch information
DamienCassou authored Jul 5, 2022
2 parents 7fb583a + c550f0e commit 5b57543
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/helpers/expect-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function getInitialReceiver (node) {
}
}

const expectRegexp = /^expect\([^)]*\)\.(not\.)?(?:to\.)?(.*)$/s
const expectRegexp = /^expect\([^)]*\)\s*\.\s*(not\s*\.)?\s*(?:to\s*\.)?\s*(.*)$/s

/**
* Convert `expectNode`, a call to `expect()` with some chainers into
Expand Down
4 changes: 2 additions & 2 deletions lib/rules/no-single-expect-in-then-or-should.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ module.exports = {
//----------------------------------------------------------------------

/**
* Use `fixer` to rewrite `node` (a call to `then()` or `should()`
* with a lonely `expect()` call as body).
* Use `fixer` to rewrite `thenOrShouldCallNode` (a call to
* `then()` or `should()` with a lonely `expect()` call as body).
*/
function fixCall (fixer, thenOrShouldCallNode, expectNode) {
// shouldString is, e.g., .should("equal", 2)
Expand Down
2 changes: 1 addition & 1 deletion 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 package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@finsit/eslint-plugin-cypress",
"version": "3.1.0",
"version": "3.1.1",
"description": "An ESLint plugin for projects using Cypress",
"main": "index.js",
"author": "Chris Breiding (chris@cypress.io)",
Expand Down
5 changes: 5 additions & 0 deletions tests/lib/rules/no-single-expect-in-then-or-should.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,10 @@ ruleTester.run('no-single-expect-in-then-or-should', rule, {
errors: [thenError],
output: 'cy.should("match", "checked")',
},
{
code: 'cy.then(($a) => {expect($a) .to.have.attr("href")})',
errors: [thenError],
output: 'cy.should("have.attr", "href")',
},
],
})

0 comments on commit 5b57543

Please sign in to comment.