-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #207 from MikeMcC399/migrate/ruletester-v9
chore: migrate to RuleTester v9
- Loading branch information
Showing
10 changed files
with
158 additions
and
215 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,39 @@ | ||
'use strict' | ||
|
||
//------------------------------------------------------------------------------ | ||
// Requirements | ||
//------------------------------------------------------------------------------ | ||
|
||
const rule = require('../../../lib/rules/no-force') | ||
|
||
const RuleTester = require('eslint').RuleTester | ||
|
||
const errors = [{ messageId: 'unexpected' }] | ||
const parserOptions = { ecmaVersion: 2018 } | ||
const ruleTester = new RuleTester() | ||
|
||
//------------------------------------------------------------------------------ | ||
// Tests | ||
//------------------------------------------------------------------------------ | ||
|
||
let ruleTester = new RuleTester() | ||
const errors = [{ messageId: 'unexpected' }] | ||
|
||
ruleTester.run('no-force', rule, { | ||
|
||
valid: [ | ||
{ code: `cy.get('button').click()`, parserOptions }, | ||
{ code: `cy.get('button').click({multiple: true})`, parserOptions }, | ||
{ code: `cy.get('button').dblclick()`, parserOptions }, | ||
{ code: `cy.get('input').type('somth')`, parserOptions }, | ||
{ code: `cy.get('input').type('somth', {anyoption: true})`, parserOptions }, | ||
{ code: `cy.get('input').trigger('click', {anyoption: true})`, parserOptions }, | ||
{ code: `cy.get('input').rightclick({anyoption: true})`, parserOptions }, | ||
{ code: `cy.get('input').check()`, parserOptions }, | ||
{ code: `cy.get('input').select()`, parserOptions }, | ||
{ code: `cy.get('input').focus()`, parserOptions }, | ||
{ code: `cy.document().trigger("keydown", { ...event })`, parserOptions }, | ||
{ code: `cy.get('button').click()` }, | ||
{ code: `cy.get('button').click({multiple: true})` }, | ||
{ code: `cy.get('button').dblclick()` }, | ||
{ code: `cy.get('input').type('somth')` }, | ||
{ code: `cy.get('input').type('somth', {anyoption: true})` }, | ||
{ code: `cy.get('input').trigger('click', {anyoption: true})` }, | ||
{ code: `cy.get('input').rightclick({anyoption: true})` }, | ||
{ code: `cy.get('input').check()` }, | ||
{ code: `cy.get('input').select()` }, | ||
{ code: `cy.get('input').focus()` }, | ||
{ code: `cy.document().trigger("keydown", { ...event })` }, | ||
], | ||
|
||
invalid: [ | ||
{ code: `cy.get('button').click({force: true})`, parserOptions, errors }, | ||
{ code: `cy.get('button').dblclick({force: true})`, parserOptions, errors }, | ||
{ code: `cy.get('input').type('somth', {force: true})`, parserOptions, errors }, | ||
{ code: `cy.get('div').find('.foo').type('somth', {force: true})`, parserOptions, errors }, | ||
{ code: `cy.get('div').find('.foo').find('.bar').click({force: true})`, parserOptions, errors }, | ||
{ code: `cy.get('div').find('.foo').find('.bar').trigger('change', {force: true})`, parserOptions, errors }, | ||
{ code: `cy.get('input').trigger('click', {force: true})`, parserOptions, errors }, | ||
{ code: `cy.get('input').rightclick({force: true})`, parserOptions, errors }, | ||
{ code: `cy.get('input').check({force: true})`, parserOptions, errors }, | ||
{ code: `cy.get('input').select({force: true})`, parserOptions, errors }, | ||
{ code: `cy.get('input').focus({force: true})`, parserOptions, errors }, | ||
{ code: `cy.get('button').click({force: true})`, errors }, | ||
{ code: `cy.get('button').dblclick({force: true})`, errors }, | ||
{ code: `cy.get('input').type('somth', {force: true})`, errors }, | ||
{ code: `cy.get('div').find('.foo').type('somth', {force: true})`, errors }, | ||
{ code: `cy.get('div').find('.foo').find('.bar').click({force: true})`, errors }, | ||
{ code: `cy.get('div').find('.foo').find('.bar').trigger('change', {force: true})`, errors }, | ||
{ code: `cy.get('input').trigger('click', {force: true})`, errors }, | ||
{ code: `cy.get('input').rightclick({force: true})`, errors }, | ||
{ code: `cy.get('input').check({force: true})`, errors }, | ||
{ code: `cy.get('input').select({force: true})`, errors }, | ||
{ code: `cy.get('input').focus({force: true})`, errors }, | ||
], | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,23 @@ | ||
'use strict' | ||
|
||
//------------------------------------------------------------------------------ | ||
// Requirements | ||
//------------------------------------------------------------------------------ | ||
|
||
const rule = require('../../../lib/rules/no-pause') | ||
|
||
const RuleTester = require('eslint').RuleTester | ||
|
||
const errors = [{ messageId: 'unexpected' }] | ||
const parserOptions = { ecmaVersion: 2018 } | ||
|
||
//------------------------------------------------------------------------------ | ||
// Tests | ||
//------------------------------------------------------------------------------ | ||
|
||
const ruleTester = new RuleTester() | ||
|
||
const errors = [{ messageId: 'unexpected' }] | ||
|
||
ruleTester.run('no-pause', rule, { | ||
|
||
valid: [ | ||
{ code: `pause()`, parserOptions }, | ||
{ code: `cy.get('button').dblclick()`, parserOptions }, | ||
{ code: `pause()` }, | ||
{ code: `cy.get('button').dblclick()` }, | ||
], | ||
|
||
invalid: [ | ||
{ code: `cy.pause()`, parserOptions, errors }, | ||
{ code: `cy.pause({ log: false })`, parserOptions, errors }, | ||
{ code: `cy.get('button').pause()`, parserOptions, errors }, | ||
{ | ||
code: `cy.get('a').should('have.attr', 'href').and('match', /dashboard/).pause()`, | ||
parserOptions, | ||
errors | ||
} | ||
{ code: `cy.pause()`, errors }, | ||
{ code: `cy.pause({ log: false })`, errors }, | ||
{ code: `cy.get('button').pause()`, errors }, | ||
{ code: `cy.get('a').should('have.attr', 'href').and('match', /dashboard/).pause()`, errors } | ||
], | ||
}) |
Oops, something went wrong.