Skip to content

Commit

Permalink
Tests news (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
BePasquet authored Sep 7, 2023
1 parent a3043c0 commit f61968c
Show file tree
Hide file tree
Showing 20 changed files with 2,450 additions and 122 deletions.
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM --platform=linux/amd64 docker.io/node:lts-alpine as builder
WORKDIR /app
COPY . .
RUN npm i
RUN npm run build


FROM nginx
EXPOSE 3000
COPY nginx/default.conf /etc/nginx/conf.d/default.conf
COPY --from=builder app/dist/news /usr/share/nginx/html
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,40 @@
# News App

Assignment for Manantal

### Specifications

- Bootstrapped with nx
- React
- React router
- Redux toolkit
- Styled components
- Material ui
- ci github actions

### Set up

#### Install dependencies

`npm i`

#### Serve development environment

`npm start`

#### Simulate production environment with docker and nginx

- run docker on desktop
- build image
`npm run build-production-image`
- run image
`npm run start-production`

#### Run test

`npm test`

#### Notes

I wrote tests as example will take me to much time to write tests for everything can see examples of a test of state in `src/app/news/state/news.state.test.ts` a component without state `src/app/shared/components/results/results.test.tsx` and a component with state and props `src/app/news/components/sources-filter/sources-filter.test.tsx`, same with comments you can see and example on `src/app/shared/components/results/results.tsx`
Hope you like it
9 changes: 9 additions & 0 deletions nginx/default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
server {
listen 3000;

location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
}
Loading

0 comments on commit f61968c

Please sign in to comment.