From 4518318c9ec206ea812b300c7e35bad289f32dda Mon Sep 17 00:00:00 2001 From: Jad Date: Mon, 22 Jul 2024 17:23:16 -0700 Subject: [PATCH] configure code cov --- submit-web/cypress.config.cjs | 8 +++ submit-web/cypress/support/component.ts | 1 + submit-web/package-lock.json | 9 +++ submit-web/package.json | 1 + submit-web/src/routeTree.gen.ts | 82 +------------------------ 5 files changed, 21 insertions(+), 80 deletions(-) diff --git a/submit-web/cypress.config.cjs b/submit-web/cypress.config.cjs index 7dc88f8b..620c8fd8 100644 --- a/submit-web/cypress.config.cjs +++ b/submit-web/cypress.config.cjs @@ -9,5 +9,13 @@ module.exports = defineConfig({ framework: "react", bundler: "vite", }, + setupNodeEvents(on, config) { + require('@cypress/code-coverage/task')(on, config) + // include any other plugin code... + + // It's IMPORTANT to return the config object + // with any changed environment variables + return config + }, }, }); diff --git a/submit-web/cypress/support/component.ts b/submit-web/cypress/support/component.ts index f412d0d8..f5484b19 100644 --- a/submit-web/cypress/support/component.ts +++ b/submit-web/cypress/support/component.ts @@ -20,6 +20,7 @@ import './commands' // require('./commands') import { mount } from 'cypress/react18' +import '@cypress/code-coverage/support' // Augment the Cypress namespace to include type definitions for // your custom command. diff --git a/submit-web/package-lock.json b/submit-web/package-lock.json index a1772958..26da21a0 100644 --- a/submit-web/package-lock.json +++ b/submit-web/package-lock.json @@ -1572,6 +1572,15 @@ "@babel/types": "^7.20.7" } }, + "@types/cypress__code-coverage": { + "version": "3.10.2", + "resolved": "https://registry.npmjs.org/@types/cypress__code-coverage/-/cypress__code-coverage-3.10.2.tgz", + "integrity": "sha512-xfM0eQZws8rE7EpTdcK2bZLJLwn87hdxzEBJBrdWnXrZC5V1o4AIjFiU1e04vLjmVVSlB9ZwrNDHjH1IZGIqQg==", + "dev": true, + "requires": { + "cypress": "*" + } + }, "@types/estree": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", diff --git a/submit-web/package.json b/submit-web/package.json index 1aae1eac..db1d76ab 100644 --- a/submit-web/package.json +++ b/submit-web/package.json @@ -31,6 +31,7 @@ "devDependencies": { "@cypress/code-coverage": "^3.12.44", "@tanstack/eslint-plugin-query": "^5.43.1", + "@types/cypress__code-coverage": "^3.10.2", "@types/node": "^20.14.9", "@types/react": "^18.2.47", "@types/react-dom": "^18.2.18", diff --git a/submit-web/src/routeTree.gen.ts b/submit-web/src/routeTree.gen.ts index 54175215..c48c61ef 100644 --- a/submit-web/src/routeTree.gen.ts +++ b/submit-web/src/routeTree.gen.ts @@ -16,10 +16,6 @@ import { Route as rootRoute } from './routes/__root' import { Route as OidcCallbackImport } from './routes/oidc-callback' import { Route as AuthenticatedImport } from './routes/_authenticated' import { Route as IndexImport } from './routes/index' -import { Route as EaoPlansIndexImport } from './routes/eao-plans/index' -import { Route as EaoPlansPlanIdImport } from './routes/eao-plans/$planId' -import { Route as AuthenticatedProfileImport } from './routes/_authenticated/profile' -import { Route as AuthenticatedUsersIndexImport } from './routes/_authenticated/users/index' // Create Virtual Routes @@ -53,26 +49,6 @@ const IndexRoute = IndexImport.update({ getParentRoute: () => rootRoute, } as any) -const EaoPlansIndexRoute = EaoPlansIndexImport.update({ - path: '/eao-plans/', - getParentRoute: () => rootRoute, -} as any) - -const EaoPlansPlanIdRoute = EaoPlansPlanIdImport.update({ - path: '/eao-plans/$planId', - getParentRoute: () => rootRoute, -} as any) - -const AuthenticatedProfileRoute = AuthenticatedProfileImport.update({ - path: '/profile', - getParentRoute: () => AuthenticatedRoute, -} as any) - -const AuthenticatedUsersIndexRoute = AuthenticatedUsersIndexImport.update({ - path: '/users/', - getParentRoute: () => AuthenticatedRoute, -} as any) - // Populate the FileRoutesByPath interface declare module '@tanstack/react-router' { @@ -112,34 +88,6 @@ declare module '@tanstack/react-router' { preLoaderRoute: typeof NewpageLazyImport parentRoute: typeof rootRoute } - '/_authenticated/profile': { - id: '/_authenticated/profile' - path: '/profile' - fullPath: '/profile' - preLoaderRoute: typeof AuthenticatedProfileImport - parentRoute: typeof AuthenticatedImport - } - '/eao-plans/$planId': { - id: '/eao-plans/$planId' - path: '/eao-plans/$planId' - fullPath: '/eao-plans/$planId' - preLoaderRoute: typeof EaoPlansPlanIdImport - parentRoute: typeof rootRoute - } - '/eao-plans/': { - id: '/eao-plans/' - path: '/eao-plans' - fullPath: '/eao-plans' - preLoaderRoute: typeof EaoPlansIndexImport - parentRoute: typeof rootRoute - } - '/_authenticated/users/': { - id: '/_authenticated/users/' - path: '/users' - fullPath: '/users' - preLoaderRoute: typeof AuthenticatedUsersIndexImport - parentRoute: typeof AuthenticatedImport - } } } @@ -147,15 +95,9 @@ declare module '@tanstack/react-router' { export const routeTree = rootRoute.addChildren({ IndexRoute, - AuthenticatedRoute: AuthenticatedRoute.addChildren({ - AuthenticatedProfileRoute, - AuthenticatedUsersIndexRoute, - }), OidcCallbackRoute, AboutpageLazyRoute, NewpageLazyRoute, - EaoPlansPlanIdRoute, - EaoPlansIndexRoute, }) /* prettier-ignore-end */ @@ -170,20 +112,14 @@ export const routeTree = rootRoute.addChildren({ "/_authenticated", "/oidc-callback", "/aboutpage", - "/newpage", - "/eao-plans/$planId", - "/eao-plans/" + "/newpage" ] }, "/": { "filePath": "index.tsx" }, "/_authenticated": { - "filePath": "_authenticated.tsx", - "children": [ - "/_authenticated/profile", - "/_authenticated/users/" - ] + "filePath": "_authenticated.tsx" }, "/oidc-callback": { "filePath": "oidc-callback.tsx" @@ -193,20 +129,6 @@ export const routeTree = rootRoute.addChildren({ }, "/newpage": { "filePath": "newpage.lazy.tsx" - }, - "/_authenticated/profile": { - "filePath": "_authenticated/profile.tsx", - "parent": "/_authenticated" - }, - "/eao-plans/$planId": { - "filePath": "eao-plans/$planId.tsx" - }, - "/eao-plans/": { - "filePath": "eao-plans/index.tsx" - }, - "/_authenticated/users/": { - "filePath": "_authenticated/users/index.tsx", - "parent": "/_authenticated" } } }