Skip to content

Commit

Permalink
Merge pull request #260 from Arquisoft/develop
Browse files Browse the repository at this point in the history
Corrigiendo errores menores
  • Loading branch information
UO277876 authored May 2, 2022
2 parents d0c7f76 + 1fc1068 commit 1f520dc
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 48 deletions.
6 changes: 3 additions & 3 deletions restapi/server.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import express, {Request, Response} from 'express';
import cors from "cors";
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';
Expand All @@ -9,8 +9,8 @@ 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())
Expand Down
17 changes: 1 addition & 16 deletions restapi/tests/api.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,6 @@ let app: Application;
const servidor = require('./servidor_test');

beforeAll(async () => {
/* app = express();
const port: number = 5000;
const options: cors.CorsOptions = {
origin: ['http://localhost:3000']
};
app.use(cors(options));
app.use(bp.json());
app.use("/api", api);
server = app.listen(port, (): void => {
console.log('Servidor Restapi para testing escuchando en ' + port);
}).on("error", (error: Error) => {
console.error('Error ocurrido: ' + error.message);
}) */

// Iniciar la base de datos
await servidor.startBD();
// Iniciar el servidor
Expand Down Expand Up @@ -110,7 +95,7 @@ describe('pedidos', () => {

expect(response.statusCode).toBe(200);

// admin tiene 3 pedidos
// admin tiene 4 pedidos
expect(pedidos.length).toEqual(4);
});
});
3 changes: 0 additions & 3 deletions restapi/tests/servidor_test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

const { MongoMemoryServer } = require("mongodb-memory-server");
const express = require('express');
const cors = require('cors');
const mongoose = require('mongoose');
const api = require('../api');

Expand All @@ -32,8 +31,6 @@

var app = express();

app.use(cors());
app.options("*", cors());
app.use(express.json());
app.use("/api", api);

Expand Down
5 changes: 5 additions & 0 deletions webapp/jest.config.ts
Original file line number Diff line number Diff line change
@@ -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"
},

}
7 changes: 7 additions & 0 deletions webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
File renamed without changes.
26 changes: 0 additions & 26 deletions webapp/src/test/Home/Shoes.test.tsx

This file was deleted.

0 comments on commit 1f520dc

Please sign in to comment.