Skip to content

Commit

Permalink
used supertest
Browse files Browse the repository at this point in the history
  • Loading branch information
anushac14 committed Aug 12, 2024
1 parent ff5d5de commit 57e9e09
Show file tree
Hide file tree
Showing 9 changed files with 235 additions and 90 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
run: npm i

- name: Install dev dependencies
run: npm install --save-dev jest chai supertest mongoose sinon dotenv
run: npm install --save-dev jest chai supertest mongoose sinon dotenv chai-http

- name: Run tests
run: npm test
Expand Down
19 changes: 3 additions & 16 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// app.js
const express = require('express');
const mongoose = require('mongoose');
require('dotenv').config();
Expand All @@ -19,20 +20,6 @@ app.use('/api/stakeholders', stakeholderRoutes);
app.use('/api/documents', documentRoutes);
app.use('/api/fundraisingRounds', fundraisingRoundRoutes);
app.use('/api/equityPlans', equityPlanRoutes);
app.use('/api/documentEmbeddings', documentEmbeddingRoutes);
app.use('/api/documentEmbeddings', documentEmbeddingRoutes);

const connectDB = async () => {
try {
const uri = process.env.MONGODB_URI;
if (!uri) {
throw new Error("MONGODB_URI is not defined in the environment variables.");
}
await mongoose.connect(uri, { useNewUrlParser: true, useUnifiedTopology: true });
console.log('MongoDB connected');
} catch (err) {
console.error(err.message);
process.exit(1);
}
};

module.exports = { app, connectDB };
module.exports = app; // Only export the Express app
2 changes: 1 addition & 1 deletion controllers/employeeController.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const Employee = require("../models/employee");
const Employee = require("../models/employeeModel");

// Create a new employee
exports.createEmployee = async (req, res) => {
Expand Down
File renamed without changes.
Loading

0 comments on commit 57e9e09

Please sign in to comment.