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
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x, 22.x, 23.x]

steps:
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 8

- name: Install dependencies
run: pnpm install

- name: Build
run: pnpm build

- name: Test
run: pnpm test

- name: Test Coverage
run: pnpm test:coverage
19 changes: 19 additions & 0 deletions src/shell-server/__tests__/shell-config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,25 @@ vi.mock('../lib/logger.js', () => ({
}
}));

// Mock the shell-config module for all tests
vi.mock('../shell-config.js', () => {
// Default implementation that can be overridden in individual tests
return {
default: () => {
if (process.env.SHELL) {
return process.env.SHELL;
}

const options = mockOpts();
if (options.shell) {
return options.shell;
}

return mockPlatform() === 'win32' ? 'cmd.exe' : '/bin/bash';
}
};
});

describe('Shell configuration', () => {
beforeEach(() => {
// Reset all mocks
Expand Down