-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #51 from michaellatman/devin/1734011974-fix-env-vars
fix: use 'env' instead of 'envVars' in Claude desktop config
- Loading branch information
Showing
6 changed files
with
76 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Jest Tests | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '18' | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Run Jest tests | ||
run: npm test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { jest, describe, it, expect, beforeEach } from '@jest/globals'; | ||
import { ConfigManager } from '../config-manager'; | ||
import { Package } from '../../types/package'; | ||
import fs from 'fs'; | ||
import path from 'path'; | ||
|
||
jest.mock('fs'); | ||
jest.mock('path'); | ||
|
||
describe('ConfigManager', () => { | ||
beforeEach(() => { | ||
jest.clearAllMocks(); | ||
}); | ||
|
||
describe('installPackage', () => { | ||
it('should create config with "env" key for environment variables', async () => { | ||
const mockPackage: Package = { | ||
name: 'test-package', | ||
description: 'Test package for config manager', | ||
runtime: 'node', | ||
vendor: 'test-vendor', | ||
sourceUrl: 'https://github.com/test/test-package', | ||
homepage: 'https://test-package.com', | ||
license: 'MIT' | ||
}; | ||
|
||
const mockEnvVars = { | ||
TEST_KEY: 'test-value' | ||
}; | ||
|
||
const writeFileSpy = jest.spyOn(fs, 'writeFileSync'); | ||
|
||
await ConfigManager.installPackage(mockPackage, mockEnvVars); | ||
|
||
expect(writeFileSpy).toHaveBeenCalled(); | ||
const writtenConfig = JSON.parse(writeFileSpy.mock.calls[0][1] as string); | ||
expect(writtenConfig.mcpServers['test-package'].env).toBeDefined(); | ||
expect(writtenConfig.mcpServers['test-package'].envVars).toBeUndefined(); | ||
expect(writtenConfig.mcpServers['test-package'].env).toEqual(mockEnvVars); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters