File tree Expand file tree Collapse file tree 4 files changed +21
-35
lines changed Expand file tree Collapse file tree 4 files changed +21
-35
lines changed Original file line number Diff line number Diff line change 1
- name : Node.js CI
1
+ name : Build and Test API
2
2
3
3
on :
4
4
push :
@@ -11,9 +11,9 @@ defaults:
11
11
working-directory : mobile-api
12
12
13
13
jobs :
14
- lint -and-test :
15
- name : Lint and Test
16
- runs-on : ubuntu-22.04
14
+ build -and-test :
15
+ name : Build and Test API
16
+ runs-on : ubuntu-latest
17
17
18
18
strategy :
19
19
matrix :
35
35
- name : Lint source files
36
36
run : npm run lint
37
37
38
- - name : Run test
38
+ - name : Build and start container
39
+ run : docker compose -f docker-compose.dev.yml up -d
40
+
41
+ - name : Sleep for 1 minute
42
+ run : sleep 60
43
+
44
+ - name : Ping container
45
+ run : curl localhost:3000/ping
46
+
47
+ - name : Create .env file
48
+ run : cp sample.env .env
49
+
50
+ - name : Run tests
39
51
run : npm test
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
- MONGODB_URL = " mongodb://localhost:27017/mobile-api"
2
- DEV_URL = " https ://api.mobile.freecodecamp.dev "
1
+ MONGODB_URL = mongodb://localhost:27017/mobile-api
2
+ DEV_URL = http ://localhost:3000
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import 'dotenv/config';
2
2
import fetch from 'node-fetch' ;
3
3
import { Podcast } from '../models/Podcast' ;
4
4
import { Episode } from '../models/Episode' ;
5
+
5
6
interface pingEndpoint {
6
7
msg : string ;
7
8
}
@@ -12,7 +13,7 @@ interface episodeEndpoint {
12
13
}
13
14
14
15
describe ( 'podcast api' , ( ) => {
15
- const url = process . env . DEV_URL ?? 'https://api.mobile.freecodecamp.dev' ;
16
+ const url = process . env . DEV_URL ;
16
17
17
18
let localPodcastId = '' ;
18
19
let localEpisodeId = '' ;
You can’t perform that action at this time.
0 commit comments