Commit 8a83bb1 2 people authored and committed
1 parent 112e658 commit 8a83bb1 Copy full SHA for 8a83bb1
File tree 10 files changed +103
-1
lines changed
examples/react-scripts-typescript
10 files changed +103
-1
lines changed Original file line number Diff line number Diff line change 2
2
/examples/nextjs
3
3
# /examples/nextjs-webpack-5
4
4
/examples/react-scripts
5
+ /examples/react-scripts-typescript
5
6
/examples/webpack-file
6
7
/examples/react-scripts-folder
7
8
/examples/using-babel-typescript
8
9
/examples/webpack-options
9
10
# /examples/rollup
10
- /examples/sass-and-ts
11
+ /examples/sass-and-ts
Original file line number Diff line number Diff line change
1
+ {
2
+ "video" : false ,
3
+ "testFiles" : " **/*cy-spec.tsx" ,
4
+ "viewportWidth" : 500 ,
5
+ "viewportHeight" : 800 ,
6
+ "componentFolder" : " src"
7
+ }
Original file line number Diff line number Diff line change
1
+ /// <reference types="cypress" />
2
+ describe ( 'integration spec' , ( ) => {
3
+ it ( 'works' , ( ) => {
4
+ expect ( 1 ) . to . equal ( 1 )
5
+ } )
6
+ } )
Original file line number Diff line number Diff line change
1
+ const injectDevServer = require ( '@cypress/react/plugins/react-scripts' )
2
+
3
+ module . exports = ( on , config ) => {
4
+ injectDevServer ( on , config )
5
+
6
+ return config
7
+ }
Original file line number Diff line number Diff line change
1
+ declare namespace Cypress {
2
+ interface Chainable {
3
+ /**
4
+ * Custom command to select DOM element by data-cy attribute.
5
+ * @example cy.dataCy('greeting')
6
+ */
7
+ clickButtonWithText ( value : string ) : Chainable
8
+ }
9
+ }
Original file line number Diff line number Diff line change
1
+ /// <reference types="cypress" />
2
+
3
+ Cypress . Commands . add ( 'clickButtonWithText' , ( value : string ) => {
4
+ return cy . get ( 'button' ) . contains ( value ) . click ( )
5
+ } )
Original file line number Diff line number Diff line change
1
+ {
2
+ "private" : true ,
3
+ "scripts" : {
4
+ "cy:open" : " node ../../../../scripts/cypress open-ct" ,
5
+ "start" : " react-scripts start" ,
6
+ "test" : " node ../../../../scripts/cypress run-ct"
7
+ },
8
+ "devDependencies" : {
9
+ "@cypress/react" : " file:../../dist" ,
10
+ "@types/react" : " ^17.0.0" ,
11
+ "@types/react-dom" : " ^17.0.0" ,
12
+ "cypress-circleci-reporter" : " 0.2.0" ,
13
+ "react" : " ^17.0.1" ,
14
+ "react-dom" : " ^17.0.1" ,
15
+ "react-scripts" : " 4.0.3" ,
16
+ "typescript" : " ^4.2.3"
17
+ }
18
+ }
Original file line number Diff line number Diff line change
1
+ /// <reference path="../cypress/support/index.d.ts" />
2
+
3
+ import React from 'react'
4
+ import { mount } from '@cypress/react'
5
+
6
+ it ( 'works' , ( ) => {
7
+ const click = cy . stub ( )
8
+ const App = ( ) => {
9
+ return ( < button onClick = { click } > Button!</ button > )
10
+ }
11
+
12
+ mount ( < App /> )
13
+ cy . clickButtonWithText ( 'Button!' ) . then ( ( ) => {
14
+ expect ( click ) . to . have . been . calledWith ( )
15
+ } )
16
+ } )
Original file line number Diff line number Diff line change
1
+ {
2
+ "compilerOptions" : {
3
+ "target" : "es5" ,
4
+ "lib" : [
5
+ "dom" ,
6
+ "dom.iterable" ,
7
+ "esnext"
8
+ ] ,
9
+ "allowJs" : true ,
10
+ "skipLibCheck" : true ,
11
+ "esModuleInterop" : true ,
12
+ "allowSyntheticDefaultImports" : true ,
13
+ "strict" : true ,
14
+ "forceConsistentCasingInFileNames" : true ,
15
+ "noFallthroughCasesInSwitch" : true ,
16
+ "module" : "esnext" ,
17
+ "moduleResolution" : "node" ,
18
+ "resolveJsonModule" : true ,
19
+ "isolatedModules" : true ,
20
+ "noEmit" : true ,
21
+ "jsx" : "react-jsx" ,
22
+ "types" : [
23
+ "cypress"
24
+ ]
25
+ } ,
26
+ "include" : [
27
+ "src"
28
+ ]
29
+ }
Original file line number Diff line number Diff line change @@ -11,6 +11,10 @@ function getTranspileFolders (config) {
11
11
folders . push ( config . fixturesFolder )
12
12
}
13
13
14
+ if ( config . supportFolder ) {
15
+ folders . push ( config . supportFolder )
16
+ }
17
+
14
18
return folders
15
19
}
16
20
You can’t perform that action at this time.
0 commit comments