Skip to content

Commit

Permalink
BUG: Minor Fixes
Browse files Browse the repository at this point in the history
- Made tests work
- Added basic Admin Panel
- Did prettier leading to so many changes in this commit
  • Loading branch information
ishaan812 committed Aug 22, 2023
1 parent cd9fd1f commit 2099dd9
Show file tree
Hide file tree
Showing 13 changed files with 345 additions and 165 deletions.
14 changes: 8 additions & 6 deletions __tests__/app.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import request from 'supertest';
import app from '../src/app.js';
import axios from 'axios';

describe('Test / endpoint', () => {
it('should respond with a JSON message', async () => {
const response = await request(app).get('/');
describe('API Tests', () => {
test('GET /', async () => {
const response = await axios.get('http://localhost:8080/');
expect(response.status).toBe(200);
});
test('GET /ping', async () => {
const response = await axios.get('http://localhost:8080/ping');
expect(response.status).toBe(200);
expect(response.body).toEqual({ message: 'Hello, World!' });
});
});
63 changes: 31 additions & 32 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
version: '3'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.8.2
container_name: elasticsearch
environment:
- discovery.type=single-node
- xpack.security.enabled=false
ports:
- "9200:9200"
- "9300:9300"
volumes:
- esdata:/usr/share/elasticsearch/data

app:
build:
context: .
dockerfile: docker/Dockerfile
environment:
- PORT=${PORT}
- GITHUB_API_KEY=${GITHUB_API_KEY}
- ES_HOST=host.docker.internal
ports:
- "${PORT}:${PORT}"
depends_on:
- elasticsearch
links:
- elasticsearch


volumes:
esdata:
version: '3'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.8.2
container_name: elasticsearch
environment:
- discovery.type=single-node
- xpack.security.enabled=false
ports:
- '9200:9200'
- '9300:9300'
volumes:
- esdata:/usr/share/elasticsearch/data

app:
build:
context: .
dockerfile: docker/Dockerfile
environment:
- PORT=${PORT}
- GITHUB_API_KEY=${GITHUB_API_KEY}
- ES_HOST=host.docker.internal
ports:
- '${PORT}:${PORT}'
depends_on:
- elasticsearch
links:
- elasticsearch

volumes:
esdata:
3 changes: 2 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export default {
testEnvironment: 'node',
preset: 'ts-jest/presets/default-esm',
// setupFilesAfterEnv: ["<rootDir>/src/setupTests.ts"],
preset: 'ts-jest',
transform: {
'^.+\\.m?[tj]s?$': ['ts-jest', { useESM: true }],
},
Expand Down
Loading

0 comments on commit 2099dd9

Please sign in to comment.