Skip to content

Commit

Permalink
test: refactor tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabb-c committed Apr 8, 2024
1 parent dc6764c commit f4da62b
Show file tree
Hide file tree
Showing 46 changed files with 441 additions and 368 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
run: pnpm install --frozen-lockfile

- name: Build
run: pnpm size
run: pnpm build

- name: Build Docs
run: pnpm docs:build
8 changes: 1 addition & 7 deletions .github/workflows/stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,11 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Lint (Rome)
run: pnpm lint

- name: Format (Rome)
run: pnpm format

- name: Build
run: pnpm build

- name: Test
run: pnpm test:ci
run: pnpm test

release:
name: Release
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ jobs:
run: pnpm install --frozen-lockfile

- name: Run tests
run: pnpm test:ci
run: pnpm test
4 changes: 2 additions & 2 deletions docs/src/guides/logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ Every client in Pokenode-ts can display logs from requests and responses.

To enable logs just pass `logs: true`:

```js
```ts
import { BerryClient } from 'pokenode-ts';

const api = new BerryClient({ logs: true }); // Enable logs
```

Will output:

```log
```
// success
[ Request Config ] GET | /berry/cheri
[ Response ] STATUS 200 | CACHED
Expand Down
14 changes: 7 additions & 7 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ layout: home

hero:
name: Pokenode-ts
text: Type-safe Configurable Lightweight
tagline: A lightweight Node.js wrapper for the PokéAPI with built-in types.
text: Type-Safe, Configurable, Lightweight
tagline: A powerful Node.js wrapper for the PokéAPI with built-in types.
actions:
- theme: brand
text: Get Started
Expand All @@ -15,12 +15,12 @@ hero:

features:
- icon: 🛠️
title: Built-in Typings
details: Pokenode-ts contains up-to-date typings, based on the PokéAPI Documentation.
title: Built-in Types
details: Pokenode-ts includes up-to-date type definitions based on the PokéAPI documentation, ensuring type safety and improved developer experience.
- icon: 📦
title: Request Cache
details: Utilize Axios auto-cache feature to optimize your app's performance. Store request results to prevent unnecessary network requests.
details: Leverages Axios auto-cache feature to optimize performance. Store API responses to minimize unnecessary network requests.
- icon: 🌲
title: Logs
details: Display logs for development purposes.
title: Logging
details: Provides logging functionality for development and debugging purposes.
---
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,16 @@
"types": "lib/index.d.ts",
"files": ["lib"],
"scripts": {
"build": "tsup --config tsup.config.ts",
"build": "tsup --config tsup.config.ts && size-limit",
"docs:build": "vitepress build docs",
"docs:dev": "vitepress dev docs --force",
"docs:preview": "vitepress preview docs",
"format": "biome format ./src",
"lint:ci": "biome ci src",
"prepare": "is-ci || husky install",
"prepublishOnly": "pnpm build",
"size": "pnpm build && size-limit",
"test:ci": "vitest --silent --run",
"test": "vitest",
"test:coverage": "vitest run --coverage",
"test:dev": "vitest -w",
"test:ui": "vitest --ui --api 9527"
},
"devDependencies": {
Expand All @@ -72,6 +70,7 @@
"husky": "^9.0.11",
"is-ci": "^3.0.1",
"lint-staged": "^15.2.2",
"msw": "^2.2.13",
"semantic-release": "^23.0.7",
"size-limit": "^11.1.2",
"tsup": "^8.0.2",
Expand Down
Loading

0 comments on commit f4da62b

Please sign in to comment.