mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-18 03:39:29 +00:00
chore: start adding test envoriment
This commit is contained in:
3
backend/src/__tests__/CreateUserService.spec.ts
Normal file
3
backend/src/__tests__/CreateUserService.spec.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
test("sum two number", () => {
|
||||
expect(1 + 2).toBe(3);
|
||||
});
|
||||
5
backend/src/bootstrap.ts
Normal file
5
backend/src/bootstrap.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import dotenv from "dotenv";
|
||||
|
||||
dotenv.config({
|
||||
path: process.env.NODE_ENV === "test" ? ".env.test" : ".env"
|
||||
});
|
||||
@@ -1,4 +1,4 @@
|
||||
require("dotenv/config");
|
||||
require("../bootstrap");
|
||||
|
||||
module.exports = {
|
||||
define: {
|
||||
@@ -11,5 +11,6 @@ module.exports = {
|
||||
database: process.env.DB_NAME,
|
||||
username: process.env.DB_USER,
|
||||
password: process.env.DB_PASS,
|
||||
storage: "./src/__tests__/database.sqlite",
|
||||
logging: false
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import "./bootstrap";
|
||||
import "reflect-metadata";
|
||||
import "dotenv/config";
|
||||
import "express-async-errors";
|
||||
import express, { Request, Response, NextFunction } from "express";
|
||||
import cors from "cors";
|
||||
|
||||
Reference in New Issue
Block a user