Skip to content
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
5 changes: 5 additions & 0 deletions .changeset/brave-mammals-repair.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@bnidev/js-utils": patch
---

chore: set up `vitest` configuration with coverage reporting (#4)
5 changes: 5 additions & 0 deletions .changeset/busy-snails-knock.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@bnidev/js-utils": patch
---

ci: add GitHub Actions workflow to run tests with `vitest` (#4)
33 changes: 31 additions & 2 deletions .github/workflows/build.yaml → .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Verify Build and Lint
name: CI

on:
push:
Expand Down Expand Up @@ -32,10 +32,39 @@ jobs:
- name: Run Biome
run: pnpm run check

test:
name: Run Tests
runs-on: ubuntu-latest
needs: lint

steps:
- name: Checkout code
uses: actions/checkout@v4

- uses: pnpm/action-setup@v2
with:
version: 10

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Run Tests
run: pnpm run test:coverage
env:
CI: true

build:
name: Build Package
runs-on: ubuntu-latest
needs: lint
needs:
- lint
- test

steps:
- name: Checkout code
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
dist
coverage
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ A collection of modern, typed JavaScript utility functions for working with arra

[![npm version](https://img.shields.io/npm/v/@bnidev/js-utils.svg)](https://www.npmjs.com/package/@bnidev/js-utils)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
[![CI](https://github.com/bnidev/js-utils/actions/workflows/build.yaml/badge.svg)](https://github.com/bnidev/js-utils/actions/workflows/build.yaml)

## ✨ Features

Expand Down Expand Up @@ -45,7 +46,7 @@ You can find the full documentation for all utility functions, including paramet

Generated automatically using [TypeDoc](https://typedoc.org/).

## Development & Testing
## 🧪 Development & Testing

To run lint and formatting checks:

Expand Down
8 changes: 7 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@
},
"files": {
"ignoreUnknown": false,
"includes": ["**", "!**/node_modules/**", "!**/dist/**", "!**/docs/**"]
"includes": [
"**",
"!**/node_modules/**",
"!**/dist/**",
"!**/docs/**",
"!**/coverage/**"
]
},
"formatter": {
"enabled": true,
Expand Down
11 changes: 9 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
"build": "tsup src/index.ts --format cjs,esm --dts --out-dir dist",
"docs:build": "typedoc --out docs src/index.ts --plugin typedoc-github-theme --tsconfig tsconfig.json",
"check": "biome check .",
"check:fix": "biome check --write ."
"check:fix": "biome check --write .",
"test": "vitest",
"test:watch": "vitest --watch",
"test:coverage": "vitest run --coverage",
"test:coverage:gh": "vitest run --coverage --reporter=default --reporter=github-actions-verbose"
},
"files": [
"dist",
Expand Down Expand Up @@ -49,9 +53,12 @@
"devDependencies": {
"@biomejs/biome": "2.0.0",
"@changesets/cli": "^2.29.5",
"@vitest/coverage-v8": "3.2.4",
"happy-dom": "^18.0.1",
"tsup": "^8.5.0",
"typedoc": "^0.28.5",
"typedoc-github-theme": "^0.3.0",
"typescript": "^5.8.3"
"typescript": "^5.8.3",
"vitest": "^3.2.4"
}
}
Loading
Loading