Skip to content
This repository was archived by the owner on Mar 5, 2022. It is now read-only.

Commit c69f6ac

Browse files
committed
chore: add reference types for every spec
1 parent 219b271 commit c69f6ac

8 files changed

+25
-14
lines changed

cypress/integration/alert-spec.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/// <reference types="cypress" />
2+
/// <reference types="../support" />
13
import HelloWorld from '../../src/stateless-alert.jsx'
24
import React from 'react'
35

cypress/integration/counter-spec.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/// <reference types="cypress" />
2+
/// <reference types="../support" />
13
import { Counter } from '../../src/counter.jsx'
24
import React from 'react'
35

@@ -42,6 +44,6 @@ describe('Counter cy.mounted before each test', () => {
4244
.click()
4345
cy.get(Counter)
4446
.its('state')
45-
.should('deep.equal', {count: 3})
47+
.should('deep.equal', { count: 3 })
4648
})
4749
})

cypress/integration/error-boundary-spec.js

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/// <reference types="cypress" />
2+
/// <reference types="../support" />
13
import { ErrorBoundary } from '../../src/error-boundary.jsx'
24
import React from 'react'
35

@@ -16,8 +18,7 @@ describe('Error Boundary', () => {
1618
<ChildWithoutError />
1719
</ErrorBoundary>
1820
)
19-
cy.get('h1')
20-
.should('have.text', 'Normal Child')
21+
cy.get('h1').should('have.text', 'Normal Child')
2122
cy.get(ErrorBoundary)
2223
.its('state.error')
2324
.should('not.exist')
@@ -29,15 +30,13 @@ describe('Error Boundary', () => {
2930
<ChildWithError />
3031
</ErrorBoundary>
3132
)
32-
cy.get('header h1')
33-
.should('contain', 'Something went wrong.')
34-
cy.get('header h3')
35-
.should('contain', 'failed to load')
33+
cy.get('header h1').should('contain', 'Something went wrong.')
34+
cy.get('header h3').should('contain', 'failed to load')
3635
cy.get(ErrorBoundary)
3736
.its('state.error.message')
3837
.should('equal', errorMessage)
3938
cy.get(ErrorBoundary)
4039
.its('state.error.stack')
4140
.should('contain', 'ChildWithError')
4241
})
43-
})
42+
})

cypress/integration/hello-world-spec.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/// <reference types="cypress" />
2+
/// <reference types="../support" />
13
import { HelloWorld } from '../../src/hello-world.jsx'
24
import React from 'react'
35

cypress/integration/hello-x-spec.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
/// <reference types="cypress" />
2+
/// <reference types="../support" />
13
import { HelloX, HelloState } from '../../src/hello-x.jsx'
24
import React from 'react'
35

46
/* eslint-env mocha */
57
describe('HelloX component', () => {
68
it('works', () => {
7-
cy.mount(<HelloX name="SuperMan" />)
9+
cy.mount(<HelloX name='SuperMan' />)
810
cy.contains('Hello SuperMan!')
911
})
1012
})
@@ -14,8 +16,7 @@ describe('HelloState component', () => {
1416
cy.mount(<HelloState />)
1517
cy.contains('Hello Spider-man!')
1618
const stateToSet = { name: 'React' }
17-
cy.get(HelloState)
18-
.invoke('setState', stateToSet)
19+
cy.get(HelloState).invoke('setState', stateToSet)
1920
cy.get(HelloState)
2021
.its('state')
2122
.should('deep.equal', stateToSet)

cypress/integration/stateless-spec.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/// <reference types="cypress" />
2+
/// <reference types="../support" />
13
import HelloWorld from '../../src/stateless.jsx'
24
import React from 'react'
35

@@ -7,7 +9,7 @@ describe('Stateless component', () => {
79
// pass spy and save it under an alias
810
// so we can easily get it later with cy.get('@greeting')
911
const spy = cy.spy().as('greeting')
10-
cy.mount(<HelloWorld name="Test Aficionado" click={spy} />)
12+
cy.mount(<HelloWorld name='Test Aficionado' click={spy} />)
1113
})
1214

1315
it('shows link', () => {
@@ -18,4 +20,4 @@ describe('Stateless component', () => {
1820
cy.contains('Say Hi').click()
1921
cy.get('@greeting').should('be.calledWith', 'Hi Test Aficionado')
2022
})
21-
})
23+
})

cypress/integration/transpiled-spec.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/// <reference types="cypress" />
2+
/// <reference types="../support" />
13
import { Transpiled } from '../../src/transpiled.jsx'
24
import React from 'react'
35

@@ -42,6 +44,6 @@ describe('Counter cy.mounted before each test', () => {
4244
.click()
4345
cy.get(Transpiled)
4446
.its('state')
45-
.should('deep.equal', {count: 3})
47+
.should('deep.equal', { count: 3 })
4648
})
4749
})

cypress/integration/users-spec.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/// <reference types="cypress" />
2+
/// <reference types="../support" />
23
import { Users } from '../../src/users.jsx'
34
import React from 'react'
45

0 commit comments

Comments
 (0)