Skip to content

Commit

Permalink
add test opts and cov opts for the app
Browse files Browse the repository at this point in the history
  • Loading branch information
shlokamin committed Oct 22, 2023
1 parent 0e57513 commit 34b06fa
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/app-test-build-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
make setup-js
- name: 'opentrons app frontendunit tests'
run: |
make -C app test ----collectCoverage
make -C app test-cov
- name: 'Upload coverage report'
uses: codecov/codecov-action@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -273,4 +273,4 @@ circular-dependencies-js:

.PHONY: test-js-%
test-js-%:
yarn jest $*
yarn jest $(tests) $(test_opts) $(cov_opts)
17 changes: 16 additions & 1 deletion app/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,24 @@ PATH := $(shell cd .. && yarn bin):$(PATH)
# dev server port
PORT ?= 8090

# Path of source package
SRC_PATH = app

OPENTRONS_PROJECT ?= robot-stack

# dependency directories for dev
shell_dir := ../app-shell
shell_odd_dir := ../app-shell-odd
discovery_client_dir := ../discovery-client

# These variables can be overriden when make is invoked to customize the
# behavior of jest. For instance,
# make test tests=src/pages/Labware/__tests__/hooks.test.tsx would run only the
# specified test
tests ?= $(SRC_PATH)/src
cov_opts ?= --coverage=true --ci=true --collectCoverageFrom='app/src/**/*.(js|ts|tsx)'
test_opts ?=

# standard targets
#####################################################################

Expand Down Expand Up @@ -80,4 +91,8 @@ dev-shell-odd:

.PHONY: test
test:
$(MAKE) -C .. test-js-app
make -C .. test-js-app tests=$(tests) test_opts="$(test_opts)"

.PHONY: test-cov
test-cov:
make -C .. test-js-app tests=$(tests) test_opts="$(test_opts)" cov_opts="$(cov_opts)"

0 comments on commit 34b06fa

Please sign in to comment.