Skip to content

Commit

Permalink
Merge pull request #15 from TzolkinB/feature/add-cypress-code-coverage
Browse files Browse the repository at this point in the history
Feature/add cypress code coverage
  • Loading branch information
TzolkinB authored Feb 7, 2024
2 parents 6afcb51 + c45a2d4 commit 8d1dbd7
Show file tree
Hide file tree
Showing 7 changed files with 3,531 additions and 45 deletions.
1 change: 1 addition & 0 deletions apps/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

# testing
/coverage
/.nyc_output/

# production
/build
Expand Down
19 changes: 19 additions & 0 deletions apps/.nycrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"all": true,
"extends": "@istanbuljs/nyc-config-typescript",
"check-coverage": true,
"include": [
"src/**/*.tsx"
],
"exclude": [
"cypress/**/*.*",
"**/*.d.ts",
"**/*.cy.tsx",
"**/*.cy.ts",
"node_modules"
],
"statements": 80,
"branches": 80,
"functions": 80,
"lines": 80
}
8 changes: 6 additions & 2 deletions apps/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ import { defineConfig } from "cypress"
export default defineConfig({
e2e: {
baseUrl: "http://localhost:3030",
// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
setupNodeEvents(on, config) {},
setupNodeEvents(on, config) {
// eslint-disable-next-line import/no-extraneous-dependencies, global-require, @typescript-eslint/no-var-requires
require("@cypress/code-coverage/task")(on, config)

return config
},
},
component: {
devServer: {
Expand Down
4 changes: 2 additions & 2 deletions apps/cypress/support/e2e.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable import/no-extraneous-dependencies */
// ***********************************************************
// This example support/e2e.ts is processed and
// loaded automatically before your test files.
Expand All @@ -16,8 +17,7 @@
// Import commands.js using ES2015 syntax:
// eslint-disable-next-line import/extensions, import/no-unresolved
import "./commands"
// eslint-disable-next-line import/no-extraneous-dependencies
import "@testing-library/cypress/add-commands"

import "@cypress/code-coverage/support"
// Alternatively you can use CommonJS syntax:
// require('./commands')
Loading

0 comments on commit 8d1dbd7

Please sign in to comment.