Skip to content

Commit

Permalink
test: enable coverage
Browse files Browse the repository at this point in the history
Signed-off-by: Rifa Achrinza <[email protected]>
  • Loading branch information
achrinza committed Sep 25, 2024
1 parent e2cbc56 commit 0fa8449
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 12 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: CI

on:
push:
branches:
- main
pull_request:
branches:
- main
Expand Down Expand Up @@ -97,7 +100,9 @@ jobs:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
coveralls.io:443
dl.google.com:443
objects.githubusercontent.com:443
github.com:443
registry.npmjs.org:443
Expand All @@ -116,12 +121,13 @@ jobs:
run: npm ci

- name: Run tests
run: |
npm exec \
--no \
--package=jest \
-- \
jest
run: npm test

- name: Publish Coverage Report
uses: coverallsapp/github-action@643bc377ffa44ace6394b2b5d0d3950076de9f63 # v2.3.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file: coverage/lcov.info

android-build:
name: Android Build
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
coverage/
node_modules/
.lsp/
*~
Expand All @@ -15,8 +16,6 @@ npm-debug.*
web-build/
android/
ios/
assets/*
!assets/**/*.svg
# macOS
.DS_Store

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# SBE Mental Health App

[![CI](https://github.com/safsbe/mental-health-app/actions/workflows/ci.yaml/badge.svg)](https://github.com/safsbe/mental-health-app/actions/workflows/ci.yaml)
[![Coverage Status](https://coveralls.io/repos/github/safsbe/mental-health-app/badge.svg?branch=main)](https://coveralls.io/github/safsbe/mental-health-app?branch=main)

A proof of concept application created by the SBE Innovation Team, part of the SBE NSF Council.

Expand Down
9 changes: 9 additions & 0 deletions jest.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"preset": "jest-expo",
"collectCoverage": true,
"collectCoverageFrom": [
"components/**",
"!components/__tests__/**",
"app/**"
]
}
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,12 @@
"test:watch": "jest --watchAll",
"eslint": "eslint .",
"eslint:fix": "npm run eslint -- --fix",
"prettier:cli": "prettier '**/*.md' '**/*.ts' '**/*.tsx' '**/*.js' '**/*.mjs'",
"prettier:cli": "prettier '**/*.md' '**/*.ts' '**/*.tsx' '**/*.js' '**/*.mjs' '!assets/**'",
"prettier:check": "npm run prettier:cli -- --check",
"prettier:fix": "npm run prettier:cli -- --write",
"lint:check": "npm run eslint && npm run prettier:check",
"lint:fix": "npm run eslint:fix && npm run prettier:fix"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"@expo-google-fonts/mulish": "^0.2.3",
"@expo/vector-icons": "^14.0.3",
Expand Down

0 comments on commit 0fa8449

Please sign in to comment.