Skip to content

Commit 748f3a5

Browse files
authored
chore: lint system tests in CI (#25673)
1 parent 88c2279 commit 748f3a5

File tree

138 files changed

+1376
-1276
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+1376
-1276
lines changed

packages/app/cypress/e2e/runner/ct-framework-errors.cy.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ reactVersions.forEach((reactVersion) => {
7474
})
7575

7676
verify('error on mount', {
77-
line: 6,
77+
line: 5,
7878
column: 33,
7979
uncaught: true,
8080
uncaughtMessage: 'mount error',
@@ -86,8 +86,8 @@ reactVersions.forEach((reactVersion) => {
8686
})
8787

8888
verify('sync error', {
89-
line: 11,
90-
column: 34,
89+
line: 12,
90+
column: 19,
9191
uncaught: true,
9292
uncaughtMessage: 'sync error',
9393
message: [
@@ -101,8 +101,8 @@ reactVersions.forEach((reactVersion) => {
101101
})
102102

103103
verify('async error', {
104-
line: 18,
105-
column: 38,
104+
line: 21,
105+
column: 21,
106106
uncaught: true,
107107
uncaughtMessage: 'async error',
108108
message: [
@@ -116,7 +116,7 @@ reactVersions.forEach((reactVersion) => {
116116
})
117117

118118
verify('command failure', {
119-
line: 43,
119+
line: 47,
120120
column: 8,
121121
command: 'get',
122122
message: [
@@ -148,7 +148,7 @@ describe('Next.js', {
148148
})
149149

150150
verify('error on mount', {
151-
line: 7,
151+
line: 6,
152152
column: 33,
153153
uncaught: true,
154154
uncaughtMessage: 'mount error',
@@ -160,8 +160,8 @@ describe('Next.js', {
160160
})
161161

162162
verify('sync error', {
163-
line: 12,
164-
column: 34,
163+
line: 13,
164+
column: 19,
165165
uncaught: true,
166166
uncaughtMessage: 'sync error',
167167
message: [
@@ -175,8 +175,8 @@ describe('Next.js', {
175175
})
176176

177177
verify('async error', {
178-
line: 19,
179-
column: 38,
178+
line: 22,
179+
column: 21,
180180
uncaught: true,
181181
uncaughtMessage: 'async error',
182182
message: [
@@ -189,7 +189,7 @@ describe('Next.js', {
189189
})
190190

191191
verify('command failure', {
192-
line: 44,
192+
line: 48,
193193
column: 8,
194194
command: 'get',
195195
message: [
@@ -338,8 +338,8 @@ describe('Nuxt', {
338338
'Timed out retrying',
339339
'element-that-does-not-exist',
340340
],
341-
codeFrameRegex: /Errors\.cy\.js:26/,
342-
stackRegex: /Errors\.cy\.js:26/,
341+
codeFrameRegex: /Errors\.cy\.js:25/,
342+
stackRegex: /Errors\.cy\.js:25/,
343343
})
344344
})
345345
})
@@ -465,7 +465,7 @@ angularVersions.forEach((angularVersion) => {
465465
})
466466

467467
verify('command failure', {
468-
line: 21,
468+
line: 20,
469469
column: 8,
470470
command: 'get',
471471
message: [

system-tests/.eslintignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# purposeful syntax errors
2+
system-tests/projects/config-with-ts-module-error/cypress.config.ts
3+
system-tests/projects/config-with-ts-syntax-error/cypress.config.ts
4+
system-tests/projects/e2e/cypress/e2e/stdout_exit_early_failing.cy.js
5+
system-tests/projects/e2e/cypress/e2e/typescript_syntax_error.cy.ts
6+
system-tests/projects/e2e/lib/fail.js
7+
system-tests/projects/e2e/static/fail.js
8+
system-tests/projects/ids/cypress/e2e/dom.jsx
9+
system-tests/projects/no-specs/src/Invalid.jsx
10+
system-tests/projects/todos/tests/_fixtures/bad_js.js
11+
system-tests/projects/todos/tests/_fixtures/bar.js
12+
system-tests/projects/todos/tests/_fixtures/foo.js
13+
system-tests/projects/todos/tests/_fixtures/nested/fixture.js
14+
system-tests/projects/todos/tests/_fixtures/no_format.js
15+
system-tests/projects/todos/tests/_fixtures/trailing_new_line.js
16+
system-tests/projects/todos/tests/_fixtures/user.js
17+
system-tests/project-fixtures/react/src/AppCompilationError.cy.jsx
18+
19+
# 3rd party
20+
system-tests/projects/e2e/static/jquery.js
21+
22+
# snapshots
23+
system-tests/projects/pristine/expected-cypress-js-component-create-react-app-v5/cypress.config.js
24+
system-tests/projects/pristine/expected-cypress-js-e2e/cypress.config.js
25+
system-tests/projects/pristine/expected-cypress-js-e2e-without-fixtures/cypress.config.js
26+
system-tests/projects/pristine-module/expected-cypress-js-e2e/cypress.config.js
27+
system-tests/projects/pristine-cjs-project/expected-cypress-js-component-vue.js-3-webpack/cypress.config.js

system-tests/.eslintrc.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,8 @@
1010
},
1111
"extends": [
1212
"plugin:@cypress/dev/tests"
13-
]
13+
],
14+
"rules": {
15+
"no-console": "off"
16+
}
1417
}

system-tests/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"main": "lib/fixtures.ts",
77
"browser": "lib/fixtureDirs.ts",
88
"scripts": {
9+
"lint": "eslint . --ext .js,.ts,.jsx,.tsx",
910
"type-check": "tsc --project .",
1011
"clean-deps": "find . -depth -name node_modules -type d -exec rimraf {} \\;",
1112
"preprojects:yarn:install": "yarn clean-deps",

system-tests/project-fixtures/angular/cypress/support/component.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,4 @@ declare global {
88
}
99
}
1010

11-
12-
Cypress.Commands.add('mount', mount);
11+
Cypress.Commands.add('mount', mount)

system-tests/project-fixtures/angular/src/app/components/another-child-providers.component.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ import { take } from 'rxjs/operators'
55
@Component({
66
selector: 'app-another-child',
77
template: `<button (click)="handleClick()">{{ message }}</button>`,
8-
providers: [ChildProvidersService]
8+
providers: [ChildProvidersService],
99
})
1010
export class AnotherChildProvidersComponent {
1111
message = 'default another child message'
1212

13-
constructor(private readonly service: ChildProvidersService) {}
13+
constructor (private readonly service: ChildProvidersService) {}
1414

15-
handleClick(): void {
15+
handleClick (): void {
1616
this.service.getMessage().pipe(
17-
take(1)
17+
take(1),
1818
).subscribe((message) => this.message = message)
1919
}
20-
}
20+
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { Component, EventEmitter, Output } from "@angular/core";
1+
import { Component, EventEmitter, Output } from '@angular/core'
22

33
@Component({
44
selector: 'app-button-output',
5-
template: `<button (click)="clicked.emit(true)">Click Me</button>`
5+
template: `<button (click)="clicked.emit(true)">Click Me</button>`,
66
})
77
export class ButtonOutputComponent {
88
@Output() clicked: EventEmitter<boolean> = new EventEmitter()
9-
}
9+
}

system-tests/project-fixtures/angular/src/app/components/child-providers.component.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ import { take } from 'rxjs/operators'
44

55
@Component({
66
selector: 'app-child-providers',
7-
template: `<button (click)="handleClick()">{{ message }}</button>`
7+
template: `<button (click)="handleClick()">{{ message }}</button>`,
88
})
99
export class ChildProvidersComponent {
1010
message = 'default message'
1111

12-
constructor(private readonly service: ChildProvidersService) {}
12+
constructor (private readonly service: ChildProvidersService) {}
1313

14-
handleClick(): void {
14+
handleClick (): void {
1515
this.service.getMessage().pipe(
16-
take(1)
17-
).subscribe(message => this.message = message)
16+
take(1),
17+
).subscribe((message) => this.message = message)
1818
}
19-
}
19+
}

system-tests/project-fixtures/angular/src/app/components/child-providers.service.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ import { map } from 'rxjs/operators'
55

66
@Injectable()
77
export class ChildProvidersService {
8-
constructor(private readonly http: HttpClient) {}
8+
constructor (private readonly http: HttpClient) {}
99

10-
getMessage(): Observable<string> {
10+
getMessage (): Observable<string> {
1111
return this.http.get<{ message: string }>('https://myfakeapiurl.com/api/message').pipe(
12-
map((response) => response.message)
12+
map((response) => response.message),
1313
)
1414
}
15-
}
15+
}

system-tests/project-fixtures/angular/src/app/components/child.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { Component, Input } from "@angular/core";
1+
import { Component, Input } from '@angular/core'
22

33
@Component({
4-
selector: "child-component",
5-
template: "<h1>{{msg}}</h1>",
4+
selector: 'child-component',
5+
template: '<h1>{{msg}}</h1>',
66
})
77
export class ChildComponent {
88
@Input() msg!: string;
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
import { Component } from "@angular/core";
2-
import { CounterService } from "./counter.service";
1+
import { Component } from '@angular/core'
2+
import { CounterService } from './counter.service'
33

44
@Component({
5-
selector: "counter-component",
5+
selector: 'counter-component',
66
template: `<button (click)="increment()">
77
Increment: {{ count$ | async }}
88
</button>`,
99
})
1010
export class CounterComponent {
1111
count$ = this.counterService.count$;
1212

13-
constructor(private counterService: CounterService) {}
13+
constructor (private counterService: CounterService) {}
1414

15-
increment() {
16-
this.counterService.increment();
15+
increment () {
16+
this.counterService.increment()
1717
}
1818
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { Injectable } from "@angular/core";
2-
import { BehaviorSubject } from "rxjs";
1+
import { Injectable } from '@angular/core'
2+
import { BehaviorSubject } from 'rxjs'
33

44
@Injectable()
55
export class CounterService {
66
private count = new BehaviorSubject<number>(0);
77
public count$ = this.count.asObservable();
88

9-
public increment() {
10-
this.count.next(this.count.value + 1);
9+
public increment () {
10+
this.count.next(this.count.value + 1)
1111
}
1212
}

system-tests/project-fixtures/angular/src/app/components/errors.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { Component, Input } from "@angular/core";
1+
import { Component, Input } from '@angular/core'
22

33
@Component({
4-
selector: "errors-component",
4+
selector: 'errors-component',
55
template: `<div>
66
<button id="sync-error" (click)="syncError()">Sync Error</button>
77
<button id="async-error" (click)="asyncError()">Sync Error</button>
@@ -10,11 +10,11 @@ import { Component, Input } from "@angular/core";
1010
export class ErrorsComponent {
1111
@Input() throwError!: boolean;
1212

13-
syncError() {
13+
syncError () {
1414
throw new Error('sync error')
1515
}
1616

17-
asyncError() {
17+
asyncError () {
1818
setTimeout(() => {
1919
throw new Error('async error')
2020
})

system-tests/project-fixtures/angular/src/app/components/lifecycle.component.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@ import { Component, Input, OnInit, OnChanges, SimpleChanges } from '@angular/cor
22

33
@Component({
44
selector: 'app-lifecycle',
5-
template: `<p>Hi {{ name }}. ngOnInit fired: {{ ngOnInitFired }} and ngOnChanges fired: {{ ngOnChangesFired }} and conditionalName: {{ conditionalName }}</p>`
5+
template: `<p>Hi {{ name }}. ngOnInit fired: {{ ngOnInitFired }} and ngOnChanges fired: {{ ngOnChangesFired }} and conditionalName: {{ conditionalName }}</p>`,
66
})
77
export class LifecycleComponent implements OnInit, OnChanges {
88
@Input() name = ''
99
ngOnInitFired = false
1010
ngOnChangesFired = false
1111
conditionalName = false
1212

13-
ngOnInit(): void {
13+
ngOnInit (): void {
1414
this.ngOnInitFired = true
1515
}
16-
17-
ngOnChanges(changes: SimpleChanges): void {
18-
this.ngOnChangesFired = true;
16+
17+
ngOnChanges (changes: SimpleChanges): void {
18+
this.ngOnChangesFired = true
1919
if (changes['name'].currentValue === 'CONDITIONAL NAME') {
2020
this.conditionalName = true
2121
}
2222
}
23-
}
23+
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { Component } from "@angular/core";
1+
import { Component } from '@angular/core'
22

33
@Component({
44
selector: 'app-logo',
5-
template: `<img src="assets/cypress-logo-light.png" />`
5+
template: `<img src="assets/cypress-logo-light.png" />`,
66
})
7-
export class LogoComponent {}
7+
export class LogoComponent {}

system-tests/project-fixtures/angular/src/app/components/parent-child.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ import { ChildComponent } from './child.component'
44

55
@NgModule({
66
declarations: [ParentComponent, ChildComponent],
7-
}) export class ParentChildModule {}
7+
}) export class ParentChildModule {}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { Component } from '@angular/core';
1+
import { Component } from '@angular/core'
22

33
@Component({
44
template: `
55
<app-child-providers></app-child-providers>
6-
<app-another-child></app-another-child>`
6+
<app-another-child></app-another-child>`,
77
})
8-
export class ParentProvidersComponent {}
8+
export class ParentProvidersComponent {}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { Component } from "@angular/core";
1+
import { Component } from '@angular/core'
22

33
@Component({
4-
selector: "parent-component",
4+
selector: 'parent-component',
55
template: '<child-component [msg]="msg"></child-component>',
66
})
77
export class ParentComponent {
8-
msg = "Hello World from ParentComponent";
8+
msg = 'Hello World from ParentComponent';
99
}

system-tests/project-fixtures/angular/src/app/components/projection.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ import { Component } from '@angular/core'
22

33
@Component({
44
selector: 'app-projection',
5-
template: `<h3><ng-content></ng-content></h3>`
5+
template: `<h3><ng-content></ng-content></h3>`,
66
})
7-
export class ProjectionComponent {}
7+
export class ProjectionComponent {}

0 commit comments

Comments
 (0)