Skip to content

Commit 2245f92

Browse files
Enhance project configuration and testing setup (#14)
* Enhance project configuration and testing setup - Updated ESLint configuration to ignore test helper files and added Vitest configuration. - Added Vitest as a testing framework in package.json and updated scripts for testing. - Introduced CI workflow for automated testing and linting on push and pull request events. - Created initial test files for WebScrapingApi and schema functionalities, ensuring validation and response handling. - Updated TypeScript configuration to exclude test files from the build process. * Bump version to 2.1.0 in package.json
1 parent cb0375b commit 2245f92

15 files changed

Lines changed: 1206 additions & 5 deletions

.github/workflows/ci.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: pnpm/action-setup@v4
14+
with:
15+
version: 9
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: 20
19+
cache: pnpm
20+
- run: pnpm install --frozen-lockfile
21+
- run: pnpm run lint
22+
- run: pnpm test
23+
- run: pnpm run build:esm
24+
- run: pnpm run build:cjs

eslint.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ export default tseslint.config(
66
ignores: [
77
'build/**',
88
'src/generated/**',
9+
'src/**/test-helpers.ts',
910
'lib/**',
1011
// Root JS config is not in tsconfig.json; projectService cannot load it.
1112
'eslint.config.js',
13+
'vitest.config.ts',
1214
],
1315
},
1416
eslint.configs.recommended,

package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@decodo/sdk-ts",
3-
"version": "2.0.1",
3+
"version": "2.1.0",
44
"description": "Official TypeScript SDK for the Decodo APIs",
55
"type": "module",
66
"main": "./build/cjs/index.cjs",
@@ -28,7 +28,9 @@
2828
"build:cjs": "tsc -p tsconfig.build.cjs.json",
2929
"typecheck": "tsc --noEmit",
3030
"lint": "eslint .",
31-
"lint:fix": "eslint . --fix"
31+
"lint:fix": "eslint . --fix",
32+
"test": "vitest run",
33+
"test:watch": "vitest"
3234
},
3335
"engines": {
3436
"node": ">=18.0.0"
@@ -40,7 +42,8 @@
4042
"eslint": "^9.39.1",
4143
"tsx": "^4.19.0",
4244
"typescript": "^5.3.3",
43-
"typescript-eslint": "^8.40.0"
45+
"typescript-eslint": "^8.40.0",
46+
"vitest": "^4.1.7"
4447
},
4548
"dependencies": {
4649
"json-schema-to-typescript": "^15.0.4",

0 commit comments

Comments
 (0)