Skip to content

Commit ba04b70

Browse files
authored
Merge pull request #42 from anishkny/master
Add newman API tests. Enable on TravisCI.
2 parents b8cd47d + c834af9 commit ba04b70

File tree

7 files changed

+5579
-1
lines changed

7 files changed

+5579
-1
lines changed

.circleci/config.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
version: 2
2+
3+
jobs:
4+
build:
5+
docker:
6+
- image: circleci/node:8.5.0
7+
- image: circleci/mongo:3.4.9
8+
steps:
9+
- checkout
10+
- run:
11+
name: Start app and test
12+
command: |
13+
yarn
14+
yarn run start & sleep 5
15+
curl http://localhost:3000/api/tags
16+
yarn run test
17+
- run:
18+
name: Trigger integration tests
19+
command: curl -X POST "https://circleci.com/api/v1.1/project/github/anishkny/realworld-e2e-test?circle-token=$CIRCLE_CI_TOKEN"
20+

.travis.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
language: node_js
2+
node_js: "8"
3+
4+
sudo: required
5+
services: mongodb
6+
7+
install: yarn
8+
9+
before_script: yarn start & sleep 5
10+
script: yarn test

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# ![Node/Express/Mongoose Example App](project-logo.png)
22

3+
[![Build Status](https://travis-ci.org/anishkny/node-express-realworld-example-app.svg?branch=master)](https://travis-ci.org/anishkny/node-express-realworld-example-app)
4+
35
> ### Example Node (Express + Mongoose) codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the [RealWorld](https://github.com/gothinkster/realworld-example-apps) API spec.
46
57
<a href="https://thinkster.io/tutorials/node-json-api" target="_blank"><img width="454" src="https://raw.githubusercontent.com/gothinkster/realworld/master/media/learn-btn-hr.png" /></a>

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@
44
"description": "conduit on node",
55
"main": "app.js",
66
"scripts": {
7+
"mongo:start": "docker run --name realworld-mongo -p 27017:27017 mongo & sleep 5",
78
"start": "node ./app.js",
89
"dev": "nodemon ./app.js",
9-
"test": "echo \"Error: no test specified\" && exit 1"
10+
"test": "newman run ./tests/api-tests.postman.json -e ./tests/env-api-tests.postman.json",
11+
"stop": "lsof -ti :3000 | xargs kill",
12+
"mongo:stop": "docker stop realworld-mongo && docker rm realworld-mongo"
1013
},
1114
"repository": {
1215
"type": "git",
@@ -34,6 +37,7 @@
3437
"underscore": "1.8.3"
3538
},
3639
"devDependencies": {
40+
"newman": "^3.8.2",
3741
"nodemon": "^1.11.0"
3842
}
3943
}

0 commit comments

Comments
 (0)