diff --git a/restapi/server.ts b/restapi/server.ts index d203b27..571d010 100644 --- a/restapi/server.ts +++ b/restapi/server.ts @@ -1,5 +1,6 @@ -import express, {Request, Response} from 'express'; +import express from 'express'; import mongoose from 'mongoose'; +import cors from "cors"; import { json } from 'body-parser'; import config from './config' import { productoRouter } from './rutas/productoRutas'; @@ -8,10 +9,11 @@ import { pedidoRouter } from './rutas/pedidoRutas'; import http from 'http'; import "dotenv/config"; import path from "path"; -const app = express() +const app = express() app.use(json()) +app.use(cors()) app.use(productoRouter) app.use(usuarioRouter) diff --git a/webapp/jest.config.ts b/webapp/jest.config.ts index 0153d2e..e9be530 100644 --- a/webapp/jest.config.ts +++ b/webapp/jest.config.ts @@ -1,5 +1,10 @@ export default { + collectCoverage: true, + collectCoverageFrom: [ "src/components/Cart/**","src/components/Details/**", + "src/components/Fragments/**","src/components/Home/**", "src/components/Login/**", + "src/components/Requets/**", "src/components/Developers/**" ,"src/App.tsx"], transform: { "^.+\\.tsx?$": "ts-jest" }, + } \ No newline at end of file diff --git a/webapp/package.json b/webapp/package.json index e85cc21..4f1c195 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -42,6 +42,13 @@ "eject": "react-scripts eject", "prod": "ts-node-dev ./server.ts" }, + "jest": { + "collectCoverageFrom": [ + "src/components/Cart/**","src/components/Details/**", + "src/components/Fragments/**","src/components/Home/**", "src/components/Login/**", + "src/components/Requets/**", "src/components/Developers/**" ,"src/App.tsx" + ] + }, "eslintConfig": { "extends": [ "react-app", diff --git a/webapp/src/test/Us.test.tsx/Us.test.tsx b/webapp/src/test/Developers/Us.test.tsx similarity index 100% rename from webapp/src/test/Us.test.tsx/Us.test.tsx rename to webapp/src/test/Developers/Us.test.tsx