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
30 changes: 30 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Test Docker Build

on:
pull_request:
branches:
- main

jobs:
docker-build:
runs-on: ubuntu-latest

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

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build Docker image
uses: docker/build-push-action@v6
with:
context: .
push: false
tags: planty-mcp:test
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Test Docker image
run: |
docker run --rm planty-mcp:test node --version
36 changes: 36 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Run Tests

on:
pull_request:
branches:
- main

jobs:
test:
runs-on: ubuntu-latest

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

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "18"

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9

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

- name: Run linter
run: pnpm lint

- name: Run tests
run: pnpm test

- name: Build
run: pnpm build
30 changes: 30 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
export default {
preset: 'ts-jest/presets/default-esm',
testEnvironment: 'node',
extensionsToTreatAsEsm: ['.ts'],
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
transform: {
'^.+\\.ts$': [
'ts-jest',
{
useESM: true,
tsconfig: {
module: 'ESNext',
moduleResolution: 'node',
},
},
],
},
testMatch: ['**/__tests__/**/*.test.ts', '**/?(*.)+(spec|test).ts'],
collectCoverageFrom: [
'src/**/*.ts',
'!src/**/*.d.ts',
'!src/server.ts',
'!src/http.ts',
],
coverageDirectory: 'coverage',
coverageReporters: ['text', 'lcov', 'html'],
moduleFileExtensions: ['ts', 'js', 'json'],
};
10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,26 @@
"build": "tsc && cp -r public build/",
"check": "biome check",
"lint": "biome lint",
"lint:fix": "biome format --write"
"lint:fix": "biome format --write",
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch"
},
"devDependencies": {
"@biomejs/biome": "2.2.4",
"@jest/globals": "^30.2.0",
"@types/bun": "latest",
"@types/cors": "^2.8.19",
"@types/express": "^5.0.3",
"@types/jest": "^30.0.0",
"@types/lodash": "^4.17.20",
"@types/node": "^24.6.0",
"@types/pg": "^8.15.5",
"@types/supertest": "^6.0.3",
"@types/uuid": "^11.0.0",
"i": "^0.3.7",
"jest": "^30.2.0",
"supertest": "^7.1.4",
"ts-jest": "^29.4.4",
"tsx": "^4.20.6",
"typecript": "0.0.1-security"
},
Expand Down
Loading
Loading