Loading...
Loading...
Compare original and translation side by side
exa-install-authexa-install-authmy-exa-project/
├── src/
│ ├── exa/
│ │ ├── client.ts # Exa client wrapper
│ │ ├── config.ts # Configuration management
│ │ └── utils.ts # Helper functions
│ └── index.ts
├── tests/
│ └── exa.test.ts
├── .env.local # Local secrets (git-ignored)
├── .env.example # Template for team
└── package.jsonmy-exa-project/
├── src/
│ ├── exa/
│ │ ├── client.ts # Exa client wrapper
│ │ ├── config.ts # Configuration management
│ │ └── utils.ts # Helper functions
│ └── index.ts
├── tests/
│ └── exa.test.ts
├── .env.local # Local secrets (git-ignored)
├── .env.example # Template for team
└── package.jsonundefinedundefinedundefinedundefined{
"scripts": {
"dev": "tsx watch src/index.ts",
"test": "vitest",
"test:watch": "vitest --watch"
}
}{
"scripts": {
"dev": "tsx watch src/index.ts",
"test": "vitest",
"test:watch": "vitest --watch"
}
}import { describe, it, expect, vi } from 'vitest';
import { ExaClient } from '../src/exa/client';
describe('Exa Client', () => {
it('should initialize with API key', () => {
const client = new ExaClient({ apiKey: 'test-key' });
expect(client).toBeDefined();
});
});import { describe, it, expect, vi } from 'vitest';
import { ExaClient } from '../src/exa/client';
describe('Exa Client', () => {
it('should initialize with API key', () => {
const client = new ExaClient({ apiKey: 'test-key' });
expect(client).toBeDefined();
});
});| Error | Cause | Solution |
|---|---|---|
| Module not found | Missing dependency | Run |
| Port in use | Another process | Kill process or change port |
| Env not loaded | Missing .env.local | Copy from .env.example |
| Test timeout | Slow network | Increase test timeout |
| 错误 | 原因 | 解决方案 |
|---|---|---|
| 模块未找到 | 缺少依赖 | 执行 |
| 端口被占用 | 有其他进程占用端口 | 终止该进程或更换端口 |
| 环境变量未加载 | 缺少.env.local文件 | 从.env.example复制 |
| 测试超时 | 网络缓慢 | 延长测试超时时间 |
vi.mock('@exa/sdk', () => ({
ExaClient: vi.fn().mockImplementation(() => ({
// Mock methods here
})),
}));vi.mock('@exa/sdk', () => ({
ExaClient: vi.fn().mockImplementation(() => ({
// Mock methods here
})),
}));undefinedundefinedundefinedundefinedexa-sdk-patternsexa-sdk-patterns