Skip to content

Commit e880932

Browse files
author
Tiffany Le-Nguyen
committed
chore: add cypress setup
1 parent 97cd996 commit e880932

File tree

10 files changed

+2166
-4
lines changed

10 files changed

+2166
-4
lines changed

.eslintrc.js

+3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ module.exports = {
2828
'unicorn/filename-case': 0,
2929
'unicorn/no-array-push-push': 0,
3030
},
31+
parserOptions: {
32+
sourceType: "module"
33+
},
3134
env: {
3235
jest: true,
3336
},

cypress/config/all.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"baseUrl": "http://localhost:3000/",
3+
"video": false
4+
}

cypress/fixtures/example.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "Using fixtures to represent data",
3+
"email": "hello@cypress.io",
4+
"body": "Fixtures are a great way to mock data for responses to routes"
5+
}

cypress/integration/test.spec.ts

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
describe('TypeScript spec', () => {
2+
it('works', () => {
3+
cy.wrap('foo').should('equal', 'foo')
4+
})
5+
6+
it('test', () => {
7+
expect(10).to.equal(10)
8+
})
9+
})

cypress/plugins/index.js

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/// <reference types="cypress" />
2+
// ***********************************************************
3+
// This example plugins/index.js can be used to load plugins
4+
//
5+
// You can change the location of this file or turn off loading
6+
// the plugins file with the 'pluginsFile' configuration option.
7+
//
8+
// You can read more here:
9+
// https://on.cypress.io/plugins-guide
10+
// ***********************************************************
11+
12+
// This function is called when a project is opened or re-opened (e.g. due to
13+
// the project's config changing)
14+
15+
/**
16+
* @type {Cypress.PluginConfig}
17+
*/
18+
// eslint-disable-next-line no-unused-vars
19+
module.exports = (on, config) => {
20+
// `on` is used to hook into various events Cypress emits
21+
// `config` is the resolved Cypress config
22+
}

cypress/support/commands.js

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// eslint-disable-next-line import/no-unassigned-import
2+
import '@testing-library/cypress/add-commands';

cypress/tsconfig.json

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"noEmit": true,
5+
// be explicit about types included
6+
// to avoid clashing with Jest types
7+
"types": ["cypress", "mocha", "@testing-library/cypress"]
8+
},
9+
"include": [
10+
"../node_modules/cypress",
11+
"./**/*.ts"
12+
]
13+
}

0 commit comments

Comments
 (0)