Skip to content

Commit

Permalink
ci: Add jest unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
j3soon committed Aug 4, 2024
1 parent cdc8eeb commit f33309b
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/test-with-jest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: unit-tests
on:
push:
paths:
- .github/workflows/test-with-jest.yaml
- tests/testcases/**
- tests/unit-test/**
pull_request:
jobs:
test-with-jest:
name: Unit Test with Jest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Pull docker images
run: docker compose -f tests/unit-test/compose.yml pull
- name: Start test containers
run: docker compose -f tests/unit-test/compose.yml up -d
# Start testing
- name: Test navigation
run: docker exec -t unit-test-jest-tests-1 /app/tests/unit-test/install-and-run.sh
# Clean up
- name: Stop test containers
if: always()
run: docker compose -f tests/unit-test/compose.yml down
5 changes: 3 additions & 2 deletions .github/workflows/test-with-selenium.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
name: tests
name: end-to-end-tests
on:
push:
paths:
- .github/workflows/test-with-selenium.yaml
- chrome/**
- firefox/**
- tests/scripts/**
- tests/testcases/**
- tests/end-to-end-test/**
pull_request:
jobs:
test-with-selenium:
name: Test with Selenium
name: End-to-end Test with Selenium
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# arxiv-utils

[![tests](https://img.shields.io/github/actions/workflow/status/j3soon/arxiv-utils/test-with-selenium.yaml?label=tests)](https://github.com/j3soon/arxiv-utils/actions/workflows/test-with-selenium.yaml)
[![tests](https://img.shields.io/github/actions/workflow/status/j3soon/arxiv-utils/test-with-jest.yaml?label=unit-tests)](https://github.com/j3soon/arxiv-utils/actions/workflows/test-with-jest.yaml)
[![tests](https://img.shields.io/github/actions/workflow/status/j3soon/arxiv-utils/test-with-selenium.yaml?label=end-to-end-tests)](https://github.com/j3soon/arxiv-utils/actions/workflows/test-with-selenium.yaml)
[![build](https://img.shields.io/github/actions/workflow/status/j3soon/arxiv-utils/build-and-publish.yaml)](https://github.com/j3soon/arxiv-utils/actions/workflows/build-and-publish.yaml)

[![](https://img.shields.io/chrome-web-store/v/mnhdpeipjhhkmlhlcljdjpgmilbmehij.svg)](https://chrome.google.com/webstore/detail/arxiv-utils/mnhdpeipjhhkmlhlcljdjpgmilbmehij)
Expand Down

0 comments on commit f33309b

Please sign in to comment.