Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: enable coverage #40

Merged
merged 2 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
name: CI

on:
pull_request:
branches:
- main
schedule:
- cron: '0 13 * * 6' # At 13:00 on Saturday
on: [push]

permissions: {}

Expand Down Expand Up @@ -97,7 +92,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 +113,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
Loading