Skip to content

Commit

Permalink
ci: add Unit & Integration test Gh Action (#6)
Browse files Browse the repository at this point in the history
* ci: add Unit & Integration test Gh Action

* chore: change to trigger test
  • Loading branch information
sohammondal committed Sep 9, 2024
1 parent f84fcae commit 915f6ba
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Unit & Integration Tests
on:
pull_request:
branches: [main, stage]
jobs:
Test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm i
- name: Unit & Integration Tests
run: npm run test:ci
- uses: actions/upload-artifact@v4
if: always()
with:
name: test-report.html
path: reports/test-report.html
retention-days: 30
4 changes: 2 additions & 2 deletions components/Accordion/Accordion.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { Accordion } from "./Accordion";

describe("Accordion", () => {
it("should toggle content when clicked", async () => {
const title = "Section 1";
const content = "This is the content for section 1.";
const title = "Accordion Title";
const content = "This is the content for Accordion";

render(<Accordion title={title}>{content}</Accordion>);

Expand Down

0 comments on commit 915f6ba

Please sign in to comment.