A project to learn socket io server and unit testing with jest.
- Dependencies
- Test
- DevOps
- Docker:v20.10.18
git clone https://github.com/singyichen/socket.io-server-test.git
cp .env.example .env
vim .env
npm i
In the project directory, you can run:
npm run dev
npm start
npm run test
Build docker image
docker build -t socketio_server_test:1.0.0 --no-cache .
Run container
docker run -d --name socketio_server_test -p 3000:3000 --restart=always socketio_server_test:1.0.0
Build docker image and run container
docker compose up -d
-
src
- Usage of api for project
-
test
- Unit tests for api
│ .dockerignore
│ .env.example
│ .env
│ .eslintrc.json
│ .gitignore
│ .prettierignore
│ .prettierrc.json
│ app.js
│ docker-compose.yml
│ dockerfile
│ jest.config.js
│ package-lock.json
│ package.json
│ README.md
│
├─src
│ │ api.js
│ └─ socketIO.js
│
└─test
│ config.js
└─ api.test.js