Skip to content

Commit

Permalink
Merge pull request #42 from anishkny/master
Browse files Browse the repository at this point in the history
Add newman API tests. Enable on TravisCI.
  • Loading branch information
EricSimons authored Jan 31, 2018
2 parents b8cd47d + c834af9 commit ba04b70
Show file tree
Hide file tree
Showing 7 changed files with 5,579 additions and 1 deletion.
20 changes: 20 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: 2

jobs:
build:
docker:
- image: circleci/node:8.5.0
- image: circleci/mongo:3.4.9
steps:
- checkout
- run:
name: Start app and test
command: |
yarn
yarn run start & sleep 5
curl http://localhost:3000/api/tags
yarn run test
- run:
name: Trigger integration tests
command: curl -X POST "https://circleci.com/api/v1.1/project/github/anishkny/realworld-e2e-test?circle-token=$CIRCLE_CI_TOKEN"

10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
language: node_js
node_js: "8"

sudo: required
services: mongodb

install: yarn

before_script: yarn start & sleep 5
script: yarn test
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# ![Node/Express/Mongoose Example App](project-logo.png)

[![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)

> ### 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.
<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>
Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
"description": "conduit on node",
"main": "app.js",
"scripts": {
"mongo:start": "docker run --name realworld-mongo -p 27017:27017 mongo & sleep 5",
"start": "node ./app.js",
"dev": "nodemon ./app.js",
"test": "echo \"Error: no test specified\" && exit 1"
"test": "newman run ./tests/api-tests.postman.json -e ./tests/env-api-tests.postman.json",
"stop": "lsof -ti :3000 | xargs kill",
"mongo:stop": "docker stop realworld-mongo && docker rm realworld-mongo"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -34,6 +37,7 @@
"underscore": "1.8.3"
},
"devDependencies": {
"newman": "^3.8.2",
"nodemon": "^1.11.0"
}
}
Loading

0 comments on commit ba04b70

Please sign in to comment.