Skip to content

Commit

Permalink
refactor: move linting to each lib to enable caching
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanpowell88 committed Nov 15, 2022
1 parent f73bb46 commit 03c71d9
Show file tree
Hide file tree
Showing 82 changed files with 418 additions and 266 deletions.
119 changes: 0 additions & 119 deletions .eslintignore

This file was deleted.

14 changes: 14 additions & 0 deletions cli/.eslintignore
@@ -0,0 +1,14 @@
**/__snapshots__
/build

# cli/types is linted by tslint/dtslint
/types

# these are all copied from dist'd builds from the individual libs
/angular
/react
/react18
/vue
/vue2
/svelte
/mount-utils
64 changes: 32 additions & 32 deletions cli/__snapshots__/build_spec.js
@@ -1,37 +1,37 @@
exports['package.json build outputs expected properties 1'] = {
"name": "test",
"engines": "test engines",
"version": "x.y.z",
"buildInfo": "replaced by normalizePackageJson",
"description": "Cypress is a next generation front end testing tool built for the modern web",
"homepage": "https://github.com/cypress-io/cypress",
"license": "MIT",
"bugs": {
"url": "https://github.com/cypress-io/cypress/issues"
'name': 'test',
'engines': 'test engines',
'version': 'x.y.z',
'buildInfo': 'replaced by normalizePackageJson',
'description': 'Cypress is a next generation front end testing tool built for the modern web',
'homepage': 'https://github.com/cypress-io/cypress',
'license': 'MIT',
'bugs': {
'url': 'https://github.com/cypress-io/cypress/issues',
},
"repository": {
"type": "git",
"url": "https://github.com/cypress-io/cypress.git"
'repository': {
'type': 'git',
'url': 'https://github.com/cypress-io/cypress.git',
},
"keywords": [
"automation",
"browser",
"cypress",
"cypress.io",
"e2e",
"end-to-end",
"integration",
"component",
"mocks",
"runner",
"spies",
"stubs",
"test",
"testing"
'keywords': [
'automation',
'browser',
'cypress',
'cypress.io',
'e2e',
'end-to-end',
'integration',
'component',
'mocks',
'runner',
'spies',
'stubs',
'test',
'testing',
],
"types": "types",
"scripts": {
"postinstall": "node index.js --exec install",
"size": "t=\"$(npm pack .)\"; wc -c \"${t}\"; tar tvf \"${t}\"; rm \"${t}\";"
}
'types': 'types',
'scripts': {
'postinstall': 'node index.js --exec install',
'size': 't="$(npm pack .)"; wc -c "${t}"; tar tvf "${t}"; rm "${t}";',
},
}
4 changes: 2 additions & 2 deletions cli/__snapshots__/cypress_spec.js
@@ -1,4 +1,4 @@
exports['cypress .run resolves with contents of tmp file 1'] = {
"code": 0,
"failingTests": []
'code': 0,
'failingTests': [],
}
54 changes: 27 additions & 27 deletions cli/__snapshots__/errors_spec.js
Expand Up @@ -50,8 +50,8 @@ Cypress Version: 1.2.3
`

exports['child kill error object'] = {
"description": "The Test Runner unexpectedly exited via a [36mexit[39m event with signal [36mSIGKILL[39m",
"solution": "Please search Cypress documentation for possible solutions:\n\n [34mhttps://on.cypress.io[39m\n\nCheck if there is a GitHub issue describing this crash:\n\n [34mhttps://github.com/cypress-io/cypress/issues[39m\n\nConsider opening a new issue."
'description': 'The Test Runner unexpectedly exited via a [36mexit[39m event with signal [36mSIGKILL[39m',
'solution': 'Please search Cypress documentation for possible solutions:\n\n [34mhttps://on.cypress.io[39m\n\nCheck if there is a GitHub issue describing this crash:\n\n [34mhttps://github.com/cypress-io/cypress/issues[39m\n\nConsider opening a new issue.',
}

exports['Error message'] = `
Expand All @@ -74,29 +74,29 @@ Cypress Version: 1.2.3
`

exports['errors individual has the following errors 1'] = [
"CYPRESS_RUN_BINARY",
"binaryNotExecutable",
"childProcessKilled",
"failedDownload",
"failedUnzip",
"failedUnzipWindowsMaxPathLength",
"incompatibleHeadlessFlags",
"incompatibleTestTypeFlags",
"incompatibleTestingTypeAndFlag",
"invalidCacheDirectory",
"invalidConfigFile",
"invalidCypressEnv",
"invalidOS",
"invalidRunProjectPath",
"invalidSmokeTestDisplayError",
"invalidTestingType",
"missingApp",
"missingDependency",
"missingXvfb",
"nonZeroExitCodeXvfb",
"notInstalledCI",
"smokeTestFailure",
"unexpected",
"unknownError",
"versionMismatch"
'CYPRESS_RUN_BINARY',
'binaryNotExecutable',
'childProcessKilled',
'failedDownload',
'failedUnzip',
'failedUnzipWindowsMaxPathLength',
'incompatibleHeadlessFlags',
'incompatibleTestTypeFlags',
'incompatibleTestingTypeAndFlag',
'invalidCacheDirectory',
'invalidConfigFile',
'invalidCypressEnv',
'invalidOS',
'invalidRunProjectPath',
'invalidSmokeTestDisplayError',
'invalidTestingType',
'missingApp',
'missingDependency',
'missingXvfb',
'nonZeroExitCodeXvfb',
'notInstalledCI',
'smokeTestFailure',
'unexpected',
'unknownError',
'versionMismatch',
]
26 changes: 13 additions & 13 deletions cli/__snapshots__/run_spec.js
@@ -1,27 +1,27 @@
exports['exec run .processRunOptions does not remove --record option when using --browser 1'] = [
"--run-project",
'--run-project',
null,
"--browser",
"test browser",
"--record",
"foo"
'--browser',
'test browser',
'--record',
'foo',
]

exports['exec run .processRunOptions passes --browser option 1'] = [
"--run-project",
'--run-project',
null,
"--browser",
"test browser"
'--browser',
'test browser',
]

exports['exec run .processRunOptions passes --record option 1'] = [
"--run-project",
'--run-project',
null,
"--record",
"my record id"
'--record',
'my record id',
]

exports['exec run .processRunOptions defaults to e2e testingType 1'] = [
"--run-project",
null
'--run-project',
null,
]
22 changes: 11 additions & 11 deletions cli/__snapshots__/spawn_spec.js
@@ -1,18 +1,18 @@
exports['lib/exec/spawn .start forces colors and streams when supported 1'] = {
"FORCE_COLOR": "1",
"DEBUG_COLORS": "1",
"MOCHA_COLORS": "1",
"FORCE_STDIN_TTY": "1",
"FORCE_STDOUT_TTY": "1",
"FORCE_STDERR_TTY": "1"
'FORCE_COLOR': '1',
'DEBUG_COLORS': '1',
'MOCHA_COLORS': '1',
'FORCE_STDIN_TTY': '1',
'FORCE_STDOUT_TTY': '1',
'FORCE_STDERR_TTY': '1',
}

exports['lib/exec/spawn .start does not force colors and streams when not supported 1'] = {
"FORCE_COLOR": "0",
"DEBUG_COLORS": "0",
"FORCE_STDIN_TTY": "0",
"FORCE_STDOUT_TTY": "0",
"FORCE_STDERR_TTY": "0"
'FORCE_COLOR': '0',
'DEBUG_COLORS': '0',
'FORCE_STDIN_TTY': '0',
'FORCE_STDOUT_TTY': '0',
'FORCE_STDERR_TTY': '0',
}

exports['lib/exec/spawn .start detects kill signal exits with error on SIGKILL 1'] = `
Expand Down
14 changes: 7 additions & 7 deletions cli/__snapshots__/util_spec.js
@@ -1,27 +1,27 @@
exports['config_as_object 1'] = {
"config": "{\"baseUrl\":\"http://localhost:2000\",\"watchForFileChanges\":false}"
'config': '{"baseUrl":"http://localhost:2000","watchForFileChanges":false}',
}

exports['env_as_object 1'] = {
"env": "{\"foo\":\"bar\",\"magicNumber\":1234,\"host\":\"kevin.dev.local\"}"
'env': '{"foo":"bar","magicNumber":1234,"host":"kevin.dev.local"}',
}

exports['env_as_string 1'] = {
"env": "foo=bar"
'env': 'foo=bar',
}

exports['others_unchanged 1'] = {
"foo": "bar"
'foo': 'bar',
}

exports['reporter_options_as_object 1'] = {
"reporterOptions": "{\"mochaFile\":\"results/my-test-output.xml\",\"toConsole\":true}"
'reporterOptions': '{"mochaFile":"results/my-test-output.xml","toConsole":true}',
}

exports['spec_as_array 1'] = {
"spec": "[\"a\",\"b\",\"c\"]"
'spec': '["a","b","c"]',
}

exports['spec_as_string 1'] = {
"spec": "x,y,z"
'spec': 'x,y,z',
}
1 change: 1 addition & 0 deletions cli/package.json
Expand Up @@ -16,6 +16,7 @@
"test-unit": "yarn unit",
"test-watch": "yarn unit --watch",
"types": "yarn dtslint",
"lint": "eslint --ext .js,.jsx,.ts,.tsx,.json,.vue .",
"unit": "cross-env BLUEBIRD_DEBUG=1 NODE_ENV=test mocha --reporter mocha-multi-reporters --reporter-options configFile=../mocha-reporter-config.json"
},
"dependencies": {
Expand Down

0 comments on commit 03c71d9

Please sign in to comment.