Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
test: add missing unit tests (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastiendan authored Feb 2, 2024
1 parent 4e7bdf2 commit 13513b2
Show file tree
Hide file tree
Showing 29 changed files with 12,543 additions and 10,929 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Tests
on:
pull_request:
branches:
- main
jobs:
unit-frontend:
name: Test/Unit/Frontend
runs-on: ubuntu-latest-16-core
environment: devnet-1
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up NodeJS
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'

- name: Install npm packages
run: npm ci

- name: Run Frontend unit tests
run: npm run frontend:test
env:
VITE_RECAPTCHA_SITE_KEY: ${{ vars.RECAPTCHA_SITE_KEY }}
VITE_SUBNET_REGISTRATOR_CONTRACT_ADDRESS: ${{ vars.SUBNET_REGISTRATOR_CONTRACT_ADDRESS }}
VITE_TOPOS_CORE_PROXY_CONTRACT_ADDRESS: ${{ vars.TOPOS_CORE_PROXY_CONTRACT_ADDRESS }}

unit-backend:
name: Test/Unit/Backend
runs-on: ubuntu-latest-16-core
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up NodeJS
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'

- name: Install npm packages
run: npm ci

- name: Run Backend unit tests
run: npm run backend:test
42 changes: 42 additions & 0 deletions .github/workflows/test:coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Test coverage

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
coverage:
name: Test/Coverage
runs-on: ubuntu-latest-16-core
environment: devnet-1
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up NodeJS
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'

- name: Install npm packages
run: npm ci

- name: Run Frontend test coverage
run: npm run frontend:test:coverage
env:
VITE_RECAPTCHA_SITE_KEY: ${{ vars.RECAPTCHA_SITE_KEY }}
VITE_SUBNET_REGISTRATOR_CONTRACT_ADDRESS: ${{ vars.SUBNET_REGISTRATOR_CONTRACT_ADDRESS }}
VITE_TOPOS_CORE_PROXY_CONTRACT_ADDRESS: ${{ vars.TOPOS_CORE_PROXY_CONTRACT_ADDRESS }}

- name: Run Backend test coverage
run: npm run backend:test:coverage

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
36 changes: 0 additions & 36 deletions .github/workflows/test:e2e.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ dist-ssr
*.njsproj
*.sln
*.sw?

# Test coverage
**/coverage
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
<br />
</div>

![docker-build](https://github.com/topos-protocol/faucet/actions/workflows/docker_build_push.yml/badge.svg)
![test](https://github.com/topos-protocol/faucet/actions/workflows/test.yml/badge.svg)
![release](https://img.shields.io/github/v/release/topos-protocol/faucet)
[![codecov](https://codecov.io/gh/topos-protocol/faucet/graph/badge.svg?token=vuXprzLMnZ)](https://codecov.io/gh/topos-protocol/faucet)
[![](https://dcbadge.vercel.app/api/server/7HZ8F8ykBT?style=flat)](https://discord.gg/7HZ8F8ykBT)

## Getting Started
Expand Down Expand Up @@ -60,7 +64,7 @@ If you have any questions, do not hesitate to reach us on [Discord](https://disc
## Resources

- Website: https://toposware.com
- Technical Documentation: https://docs.toposware.com
- Technical Documentation: https://docs.topos.technology
- Medium: https://toposware.medium.com
- Whitepaper: [Topos: A Secure, Trustless, and Decentralized
Interoperability Protocol](https://arxiv.org/pdf/2206.03481.pdf)
Expand Down
Loading

0 comments on commit 13513b2

Please sign in to comment.