Skip to content

Commit

Permalink
fix eslint for fixture specs (#5176)
Browse files Browse the repository at this point in the history
* update eslint to lint files within 'fixtures' in support files

- ignore some edge cases like jquery, jsx and obvious js files we wrote
with broken code

* Fixes from eslint to 'fixtures' files
  • Loading branch information
jennifer-shehane authored and kuceb committed Sep 20, 2019
1 parent 7100a41 commit b5b79fc
Show file tree
Hide file tree
Showing 21 changed files with 55 additions and 31 deletions.
7 changes: 6 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@
**/dist
**/dist-test
**/node_modules
**/support/fixtures
**/support/fixtures/*
!**/support/fixtures/projects
**/support/fixtures/projects/**/_fixtures/*
**/support/fixtures/projects/**/*.jsx
**/support/fixtures/projects/**/jquery.js
**/support/fixtures/projects/**/fail.js
**/test/fixtures
**/vendor

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
import "./does/not/exist"
import './does/not/exist'
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/* eslint-disable mocha/no-global-tests */
it('works', () => {})
Original file line number Diff line number Diff line change
@@ -1 +1 @@
import "../../lib/fail"
import '../../lib/fail'
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ describe('https passthru retries', () => {
img.onload = () => {
reject(new Error('onload event fired, but should not have. expected onerror to fire.'))
}

img.onerror = resolve
})
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ describe('network error handling', function () {
})
.get('input[type=text]')
.type('bar')

cy.get('input[type=submit]')
.click()

cy.contains('{"foo":"bar"}')
})
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ module.exports = (on) => {

'record:fast_visit_spec' ({ percentiles, url, browser, currentRetry }) {
percentiles.forEach(([percent, percentile]) => {
// eslint-disable-next-line no-console
console.log(`${percent}%\t of visits to ${url} finished in less than ${percentile}ms`)
})

Expand All @@ -110,8 +111,9 @@ module.exports = (on) => {
currentRetry,
...percentiles.reduce((acc, pair) => {
acc[pair[0]] = pair[1]

return acc
}, {})
}, {}),
}

return performance.track('fast_visit_spec percentiles', data)
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
console.log("bar")
/* eslint-disable no-console */
console.log('bar')
4 changes: 2 additions & 2 deletions packages/server/test/support/fixtures/projects/e2e/lib/bar.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import baz from "./baz"
import baz from './baz'

export default baz
export default baz
4 changes: 2 additions & 2 deletions packages/server/test/support/fixtures/projects/e2e/lib/baz.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export default () => {
return "baz"
}
return 'baz'
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-console */
module.exports = function Reporter (runner) {
runner.on('test end', function (test) {
console.log(test.title)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
context("some context[i9w]", function(){
context('some context[i9w]', function () {
it('tests[abc]')
})
})
Original file line number Diff line number Diff line change
@@ -1 +1 @@
import "./dom.jsx"
import './dom.jsx'
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
module.exports = (on) => {
on('task', {
'one' () { return 'one' },
'two' () { return 'two' },
'one' () {
return 'one'
},
'two' () {
return 'two'
},
})

on('task', {
'two' () { return 'two again' },
'three' () { return 'three' },
'two' () {
return 'two again'
},
'three' () {
return 'three'
},
})
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
beforeEach(function(){
beforeEach(function () {

});
})
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
it("tests without a server", function(){
/* eslint-disable mocha/no-global-tests */
it('tests without a server', function () {

});
})
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* global document */

const el = document.getElementById('extension')

if (el) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,22 @@
"version": "0",
"description": "tests adding user extension into Cypress",
"permissions": [
"tabs", "webNavigation", "<all_urls>"
"tabs",
"webNavigation",
"<all_urls>"
],
"content_scripts": [
{
"matches": ["<all_urls>"],
"matches": [
"<all_urls>"
],
"exclude_matches": [
"*://*/__cypress/*",
"*://*/__/*"
],
"js": ["background.js"],
"js": [
"background.js"
],
"run_at": "document_end",
"all_frames": true
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* global Promise */

module.exports = (on) => {
on('file:preprocessor', () => {
return new Promise(() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
it("is truthy", function(){
/* eslint-disable mocha/no-global-tests */
it('is truthy', function () {
expect(true).to.be.true
})
})
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* global it, expect */

/* eslint-disable mocha/no-global-tests */
it('is another spec', () => {
expect(false).to.be.false
})

4 comments on commit b5b79fc

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on b5b79fc Sep 20, 2019

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.

You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.

You will need to use custom CYPRESS_INSTALL_BINARY url and install Cypress using an url instead of the version.

export CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/3.5.0/linux-x64/circle-develop-b5b79fc9afa4a3b9377283d4db4ae3725c1d7853-153420/cypress.zip
npm install https://cdn.cypress.io/beta/npm/3.5.0/circle-develop-b5b79fc9afa4a3b9377283d4db4ae3725c1d7853-153416/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on b5b79fc Sep 20, 2019

Choose a reason for hiding this comment

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

AppVeyor has built the win32 ia32 version of the Test Runner.

You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.

You will need to use custom CYPRESS_INSTALL_BINARY url and install Cypress using an url instead of the version.

set CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/3.5.0/win32-ia32/appveyor-develop-b5b79fc9afa4a3b9377283d4db4ae3725c1d7853-27561377/cypress.zip
npm install https://cdn.cypress.io/beta/binary/3.5.0/win32-ia32/appveyor-develop-b5b79fc9afa4a3b9377283d4db4ae3725c1d7853-27561377/cypress.zip

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on b5b79fc Sep 20, 2019

Choose a reason for hiding this comment

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

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

You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.

You will need to use custom CYPRESS_INSTALL_BINARY url and install Cypress using an url instead of the version.

set CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/3.5.0/win32-x64/appveyor-develop-b5b79fc9afa4a3b9377283d4db4ae3725c1d7853-27561377/cypress.zip
npm install https://cdn.cypress.io/beta/binary/3.5.0/win32-x64/appveyor-develop-b5b79fc9afa4a3b9377283d4db4ae3725c1d7853-27561377/cypress.zip

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on b5b79fc Sep 20, 2019

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.

You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.

You will need to use custom CYPRESS_INSTALL_BINARY url and install Cypress using an url instead of the version.

export CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/3.5.0/darwin-x64/circle-develop-b5b79fc9afa4a3b9377283d4db4ae3725c1d7853-153435/cypress.zip
npm install https://cdn.cypress.io/beta/npm/3.5.0/circle-develop-b5b79fc9afa4a3b9377283d4db4ae3725c1d7853-153434/cypress.tgz

Please sign in to comment.