Skip to content

Commit

Permalink
chore: Add eslint config to system-test project fixtures (#25089)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbreiding authored Dec 9, 2022
1 parent fdd04c3 commit 4cb1c07
Show file tree
Hide file tree
Showing 27 changed files with 160 additions and 150 deletions.
4 changes: 2 additions & 2 deletions packages/app/cypress/e2e/runner/ct-framework-errors.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,8 @@ describe('Vue', {
'Timed out retrying',
'element-that-does-not-exist',
],
codeFrameRegex: /Errors\.cy\.js:26/,
stackRegex: /Errors\.cy\.js:26/,
codeFrameRegex: /Errors\.cy\.js:25/,
stackRegex: /Errors\.cy\.js:25/,
})
})
})
Expand Down
11 changes: 11 additions & 0 deletions system-tests/project-fixtures/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"plugins": [
"cypress"
],
"env": {
"cypress/globals": true
},
"rules": {
"mocha/no-global-tests": "off"
}
}
10 changes: 5 additions & 5 deletions system-tests/project-fixtures/cra/src/App.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logo from './logo.svg';
import './App.css';
import logo from './logo.svg'
import './App.css'

function App() {
function App () {
return (
<div className="App">
<header className="App-header">
Expand All @@ -19,7 +19,7 @@ function App() {
</a>
</header>
</div>
);
)
}

export default App;
export default App
12 changes: 6 additions & 6 deletions system-tests/project-fixtures/cra/src/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import React from 'react'
import ReactDOM from 'react-dom'
import './index.css'
import App from './App'

ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
);
document.getElementById('root'),
)
14 changes: 7 additions & 7 deletions system-tests/project-fixtures/next/cypress.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const path = require('path');
const path = require('path')

module.exports = {
component: {
Expand All @@ -10,12 +10,12 @@ module.exports = {
resolve: {
alias: {
'react': path.resolve(__dirname, './node_modules/react'),
}
}
}
}
},
},
},
},
},
// These tests should run quickly / fail quickly,
// since we intentionally causing error states for testing
defaultCommandTimeout: 1000
}
defaultCommandTimeout: 1000,
}
2 changes: 1 addition & 1 deletion system-tests/project-fixtures/next/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import '../styles/globals.css'

function MyApp({ Component, pageProps }) {
function MyApp ({ Component, pageProps }) {
return <Component {...pageProps} />
}

Expand Down
2 changes: 1 addition & 1 deletion system-tests/project-fixtures/next/pages/api/hello.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction

export default function handler(req, res) {
export default function handler (req, res) {
res.status(200).json({ name: 'John Doe' })
}
4 changes: 2 additions & 2 deletions system-tests/project-fixtures/next/pages/index.cy.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { mount } from "cypress/react"
import Index from "./index.js"
import { mount } from 'cypress/react'
import Index from './index.js'

describe('<Index />', () => {
it('renders', () => {
Expand Down
2 changes: 1 addition & 1 deletion system-tests/project-fixtures/next/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Head from 'next/head'
import Image from 'next/image'
import styles from '../styles/Home.module.css'

export default function Home() {
export default function Home () {
return (
<div className={styles.container}>
<Head>
Expand Down
4 changes: 2 additions & 2 deletions system-tests/project-fixtures/next/pages/styles.cy.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { mount } from "cypress/react"
import Index from "./index.js"
import { mount } from 'cypress/react'
import Index from './index.js'

describe('<Index />', () => {
it('renders', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ import Tutorial from './Tutorial.vue'
it('works', () => {
mount(Tutorial)
cy.contains('Nuxt')
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ import { mount } from 'cypress/react'

import './backgroundColor.css'

Cypress.Commands.add('mount', mount)
Cypress.Commands.add('mount', mount)
6 changes: 3 additions & 3 deletions system-tests/project-fixtures/react/vite.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const {defineConfig} = require('vite')
const { defineConfig } = require('vite')

module.exports = defineConfig({
resolve: {
Expand All @@ -7,5 +7,5 @@ module.exports = defineConfig({
'react-dom': require.resolve('react-dom'),
},
},
logLevel: 'silent'
})
logLevel: 'silent',
})
4 changes: 2 additions & 2 deletions system-tests/project-fixtures/react/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const path = require('path')

/**
* @type {import('webpack').Configuration}
*/
Expand All @@ -24,6 +25,5 @@ module.exports = {
use: ['style-loader', 'css-loader'],
},
],
}
},
}

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { mount } from "cypress/svelte";
import "../../src/styles.css"
import { mount } from 'cypress/svelte'
import '../../src/styles.css'

Cypress.Commands.add("mount", mount);
Cypress.Commands.add('mount', mount)
2 changes: 1 addition & 1 deletion system-tests/project-fixtures/svelte/src/App.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ it('should render with style', () => {
cy.get('.very-red').should('have.css', 'color', 'rgb(255, 0, 0)')
// Verify local styles
cy.get('.very-blue').should('have.css', 'color', 'rgb(0, 0, 255)')
})
})
3 changes: 1 addition & 2 deletions system-tests/project-fixtures/svelte/src/errors.cy.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import Errors from './Errors.svelte'

describe('Errors', () => {

it('error on mount', () => {
cy.mount(Errors, { props: { throwError: true } })
})
Expand All @@ -20,4 +19,4 @@ describe('Errors', () => {
cy.mount(Errors)
cy.get('element-that-does-not-exist')
})
})
})
10 changes: 5 additions & 5 deletions system-tests/project-fixtures/svelte/src/main.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import App from "./App.svelte";
import "./styles.css";
import App from './App.svelte'
import './styles.css'

const app = new App({
target: document.getElementById("app"),
});
target: document.getElementById('app'),
})

export default app;
export default app
Loading

5 comments on commit 4cb1c07

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 4cb1c07 Dec 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux arm64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/12.1.0/linux-arm64/develop-4cb1c074f72126918e470d3cd001ef01883f6d6a/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 4cb1c07 Dec 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/12.1.0/linux-x64/develop-4cb1c074f72126918e470d3cd001ef01883f6d6a/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 4cb1c07 Dec 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/12.1.0/darwin-x64/develop-4cb1c074f72126918e470d3cd001ef01883f6d6a/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 4cb1c07 Dec 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin arm64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/12.1.0/darwin-arm64/develop-4cb1c074f72126918e470d3cd001ef01883f6d6a/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 4cb1c07 Dec 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the win32 x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/12.1.0/win32-x64/develop-4cb1c074f72126918e470d3cd001ef01883f6d6a/cypress.tgz

Please sign in to comment.