Skip to content

Commit

Permalink
Feature/coverage (#6)
Browse files Browse the repository at this point in the history
* adding base for js coverage

* changing code to one

* adding coverage report

* adding a coverage format

* make sure things install correctly

* fixing apk

* removing code climate from tests

* test

* removing code climate test coverage id

* removing coverage for now

* run coveralls with the right report

* removing apk updates
  • Loading branch information
RyanNoelk authored Mar 20, 2018
1 parent bb2bd9a commit 5286e95
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
7 changes: 6 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,9 @@ before_install:
- docker-compose -f test.yml -p test build

script:
- docker-compose -f test.yml -p test run --rm --entrypoint 'npm test' web
- docker-compose -f test.yml -p test run --rm
--entrypoint 'npm test'
-e TRAVIS_JOB_ID=$TRAVIS_JOB_ID
-e TRAVIS_BRANCH=$TRAVIS_BRANCH
-e TRAVIS=$TRAVIS
web
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

[![Web Build Status](https://travis-ci.org/open-eats/openeats-web.svg?branch=master)](https://travis-ci.org/open-eats/openeats-web)
[![Coverage Status](https://coveralls.io/repos/github/open-eats/openeats-web/badge.svg)](https://coveralls.io/github/open-eats/openeats-web)
[![Maintainability](https://api.codeclimate.com/v1/badges/5e46696ad10370f28ba3/maintainability)](https://codeclimate.com/github/open-eats/openeats-web/maintainability)

This is the official web app that powers OpenEats. It's built using React/Redux.

Expand All @@ -18,7 +19,8 @@ To run tests locally:
```bash
cd openeats-api
docker-compose -f test.yml -p test build
docker-compose -f test.yml -p test run --rm --entrypoint 'npm test' web
docker-compose -f test.yml -p test run --rm --entrypoint sh web
./node_modules/.bin/jest --coverage
```

#### Generating locale files
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"start:prod": "webpack && node server.js",
"start:demo": "webpack",
"build": "webpack",
"test": "jest"
"test": "./tests.sh"
},
"jest": {
"moduleNameMapper": {
Expand Down
10 changes: 10 additions & 0 deletions tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env sh

# Install test related dependencies
yarn add coveralls

# Run the tests and create a coverage report
jest --coverage

# Submit coverage to Coveralls
coveralls < coverage/lcov.info

0 comments on commit 5286e95

Please sign in to comment.