Skip to content

feat: apply stylistic recommended rules to examples #966

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

Merged
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: 4 additions & 4 deletions app/commands/actions.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ <h4 id="type"><a href="https://on.cypress.io/type">.type()</a></h4>
cy.get('.action-email').type('{del}{selectall}{backspace}')

// .type() with key modifiers
cy.get('.action-email').type('{alt}{option}') //these are equivalent
cy.get('.action-email').type('{ctrl}{control}') //these are equivalent
cy.get('.action-email').type('{meta}{command}{cmd}') //these are equivalent
cy.get('.action-email').type('{alt}{option}') // these are equivalent
cy.get('.action-email').type('{ctrl}{control}') // these are equivalent
cy.get('.action-email').type('{meta}{command}{cmd}') // these are equivalent
cy.get('.action-email').type('{shift}')

// Delay each keypress by 0.1 sec
Expand Down Expand Up @@ -182,7 +182,7 @@ <h4 id="submit"><a href="https://on.cypress.io/submit">.submit()</a></h4>
<p>To submit a form, use the <a href="https://on.cypress.io/submit"><code>cy.submit()</code></a> command.</p>
<pre><code class="javascript">cy.get('.action-form')
.find('[type="text"]').type('HALFOFF')

cy.get('.action-form').submit()
cy.get('.action-form').next().should('contain', 'Your form has been submitted!')</code></pre>
</div>
Expand Down
3 changes: 2 additions & 1 deletion app/commands/misc.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ <h4 id="exec"><a href="https://on.cypress.io/exec">cy.exec()</a></h4>
if (Cypress.platform === 'win32') {
cy.exec('print cypress.config.js')
.its('stderr').should('be.empty')
} else {
}
else {
cy.exec('cat cypress.config.js')
.its('stderr').should('be.empty')

Expand Down
12 changes: 6 additions & 6 deletions app/commands/storage.html
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ <h4><a href="https://on.cypress.io/getalllocalstorage">cy.getAllLocalStorage()</
expect(storageMap).to.deep.equal({
// other origins will also be present if localStorage is set on them
'http://localhost:8080': {
'prop1': 'red',
'prop2': 'blue',
'prop3': 'magenta',
prop1: 'red',
prop2: 'blue',
prop3: 'magenta',
},
})
})</code></pre>
Expand Down Expand Up @@ -191,9 +191,9 @@ <h4><a href="https://on.cypress.io/getallsessionstorage">cy.getAllSessionStorage
expect(storageMap).to.deep.equal({
// other origins will also be present if sessionStorage is set on them
'http://localhost:8080': {
'prop4': 'cyan',
'prop5': 'yellow',
'prop6': 'black',
prop4: 'cyan',
prop5: 'yellow',
prop6: 'black',
},
})
})</code></pre>
Expand Down
2 changes: 1 addition & 1 deletion cypress.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
'projectId': '4b7344',
projectId: '4b7344',
e2e: {},
}
6 changes: 3 additions & 3 deletions cypress/e2e/2-advanced-examples/actions.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ context('Actions', () => {
cy.get('.action-email').type('{del}{selectall}{backspace}')

// .type() with key modifiers
cy.get('.action-email').type('{alt}{option}') //these are equivalent
cy.get('.action-email').type('{ctrl}{control}') //these are equivalent
cy.get('.action-email').type('{meta}{command}{cmd}') //these are equivalent
cy.get('.action-email').type('{alt}{option}') // these are equivalent
cy.get('.action-email').type('{ctrl}{control}') // these are equivalent
cy.get('.action-email').type('{meta}{command}{cmd}') // these are equivalent
cy.get('.action-email').type('{shift}')

// Delay each keypress by 0.1 sec
Expand Down
1 change: 0 additions & 1 deletion cypress/e2e/2-advanced-examples/cypress_api.cy.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/// <reference types="cypress" />

context('Cypress APIs', () => {

context('Cypress.Commands', () => {
beforeEach(() => {
cy.visit('http://localhost:8080/cypress-api')
Expand Down
3 changes: 2 additions & 1 deletion cypress/e2e/2-advanced-examples/misc.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ context('Misc', () => {
if (Cypress.platform === 'win32') {
cy.exec(`print ${Cypress.config('configFile')}`)
.its('stderr').should('be.empty')
} else {
}
else {
cy.exec(`cat ${Cypress.config('configFile')}`)
.its('stderr').should('be.empty')

Expand Down
12 changes: 6 additions & 6 deletions cypress/e2e/2-advanced-examples/storage.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ context('Local Storage / Session Storage', () => {
expect(storageMap).to.deep.equal({
// other origins will also be present if localStorage is set on them
'http://localhost:8080': {
'prop1': 'red',
'prop2': 'blue',
'prop3': 'magenta',
prop1: 'red',
prop2: 'blue',
prop3: 'magenta',
},
})
})
Expand Down Expand Up @@ -94,9 +94,9 @@ context('Local Storage / Session Storage', () => {
expect(storageMap).to.deep.equal({
// other origins will also be present if sessionStorage is set on them
'http://localhost:8080': {
'prop4': 'cyan',
'prop5': 'yellow',
'prop6': 'black',
prop4: 'cyan',
prop5: 'yellow',
prop6: 'black',
},
})
})
Expand Down
10 changes: 5 additions & 5 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ export default [
...eslintPluginJsonc.configs['flat/recommended-with-json'],
mochaPlugin.configs.recommended,
pluginCypress.configs.recommended,
stylistic.configs.recommended,
{
ignores: ['app/assets/js/vendor/'],
ignores: ['app/assets/js/{vendor,todo}/'],
},
{
plugins: {
'@stylistic': stylistic,
},
rules: {
'@stylistic/indent': ['error', 2, { 'SwitchCase': 1, 'MemberExpression': 'off' }],
'@stylistic/arrow-parens': ['error', 'always'],
'@stylistic/comma-dangle': ['error', 'always-multiline'],
'@stylistic/indent': ['error', 2, { SwitchCase: 1, MemberExpression: 'off' }],
'@stylistic/quotes': ['error', 'single'],
'@stylistic/semi': ['error', 'never'],
'@stylistic/space-before-function-paren': ['error', 'always'],
'mocha/no-exclusive-tests': 'error',
'mocha/no-pending-tests': 'error',
'mocha/no-mocha-arrows': 'off',
Expand Down
1 change: 0 additions & 1 deletion scripts/set-port.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ const newUrl = `localhost:${process.env.PORT}`

console.log('replacing "%s" with "%s" in all spec files', input, newUrl)


const getSpecFilenames = () => {
const globby = require('globby')

Expand Down