try to fix windows tests
This commit is contained in:
parent
0b323dbbd7
commit
48090f52ae
6 changed files with 16 additions and 16 deletions
|
|
@ -65,21 +65,21 @@ describe("E2E: Headless Mode with Dynamic Responses", () => {
|
|||
|
||||
// Test weather query
|
||||
const weatherResult = await runCLI(context, {
|
||||
args: ["-p", "What's the weather like?", "--config", context.configPath],
|
||||
args: ["-p", "--config", context.configPath, "What's the weather like?"],
|
||||
timeout: 15000,
|
||||
});
|
||||
expect(weatherResult.stdout).toContain("It's sunny and 72°F today!");
|
||||
|
||||
// Test time query
|
||||
const timeResult = await runCLI(context, {
|
||||
args: ["-p", "What time is it?", "--config", context.configPath],
|
||||
args: ["-p", "--config", context.configPath, "What time is it?"],
|
||||
timeout: 15000,
|
||||
});
|
||||
expect(timeResult.stdout).toContain("The current time is 3:30 PM.");
|
||||
|
||||
// Test unknown query
|
||||
const unknownResult = await runCLI(context, {
|
||||
args: ["-p", "Tell me about quantum physics", "--config", context.configPath],
|
||||
args: ["-p", "--config", context.configPath, "Tell me about quantum physics"],
|
||||
timeout: 15000,
|
||||
});
|
||||
expect(unknownResult.stdout).toContain("I don't understand your question.");
|
||||
|
|
@ -97,7 +97,7 @@ describe("E2E: Headless Mode with Dynamic Responses", () => {
|
|||
});
|
||||
|
||||
const result = await runCLI(context, {
|
||||
args: ["-p", "Test non-streaming", "--config", context.configPath],
|
||||
args: ["-p", "--config", context.configPath, "Test non-streaming"],
|
||||
timeout: 15000,
|
||||
});
|
||||
|
||||
|
|
@ -149,7 +149,7 @@ models:
|
|||
|
||||
// Test with the first model (GPT-4 should be default)
|
||||
const result = await runCLI(context, {
|
||||
args: ["-p", "Hello", "--config", context.configPath],
|
||||
args: ["-p", "--config", context.configPath, "Hello"],
|
||||
timeout: 15000,
|
||||
});
|
||||
|
||||
|
|
@ -202,7 +202,7 @@ models:
|
|||
// Make multiple requests
|
||||
for (let i = 0; i < 3; i++) {
|
||||
const result = await runCLI(context, {
|
||||
args: ["-p", `Request ${i + 1}`, "--config", context.configPath],
|
||||
args: ["-p", "--config", context.configPath, `Request ${i + 1}`],
|
||||
timeout: 15000,
|
||||
});
|
||||
expect(result.stdout).toContain(responses[i]);
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ provider: openai`
|
|||
// For now, just test that it tries to load the config
|
||||
// Without proper mocking, it will fail to connect to OpenAI
|
||||
const result = await runCLI(context, {
|
||||
args: ["-p", "Hello", "--config", configPath],
|
||||
args: ["-p", "--config", configPath, "Hello"],
|
||||
env: { OPENAI_API_KEY: "test-key" },
|
||||
expectError: true,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ describe("E2E: Headless Mode with Mock Server", () => {
|
|||
|
||||
it('should output "Hello World!" when using cn -p "Hi"', async () => {
|
||||
const result = await runCLI(context, {
|
||||
args: ["-p", "Hi", "--config", context.configPath],
|
||||
args: ["-p", "--config", context.configPath, "Hi"],
|
||||
timeout: 15000,
|
||||
});
|
||||
|
||||
|
|
@ -38,7 +38,7 @@ describe("E2E: Headless Mode with Mock Server", () => {
|
|||
|
||||
it("should handle streaming responses correctly", async () => {
|
||||
const result = await runCLI(context, {
|
||||
args: ["-p", "Say hello", "--config", context.configPath],
|
||||
args: ["-p", "--config", context.configPath, "Say hello"],
|
||||
timeout: 15000,
|
||||
});
|
||||
|
||||
|
|
@ -52,7 +52,7 @@ describe("E2E: Headless Mode with Mock Server", () => {
|
|||
|
||||
it("should work with longer prompts", async () => {
|
||||
const result = await runCLI(context, {
|
||||
args: ["-p", "Please respond with exactly 'Hello World!' and nothing else", "--config", context.configPath],
|
||||
args: ["-p", "--config", context.configPath, "Please respond with exactly 'Hello World!' and nothing else"],
|
||||
timeout: 15000,
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ describe("E2E: Headless Mode (Simple)", () => {
|
|||
no models here`);
|
||||
|
||||
const result = await runCLI(context, {
|
||||
args: ["-p", "Test", "--config", context.configPath],
|
||||
args: ["-p", "--config", context.configPath, "Test"],
|
||||
expectError: true,
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ describe("E2E: Resume Flag", () => {
|
|||
it("should resume from previous session when using --resume flag", async () => {
|
||||
// First, run a chat session with a single message
|
||||
const firstResult = await runCLI(context, {
|
||||
args: ["-p", "hello", "--config", context.configPath],
|
||||
args: ["-p", "--config", context.configPath, "hello"],
|
||||
env: {
|
||||
// Use a fixed session ID so both CLI calls use the same session
|
||||
CONTINUE_CLI_TEST_SESSION_ID: "test-session-123"
|
||||
|
|
@ -119,7 +119,7 @@ describe("E2E: Resume Flag", () => {
|
|||
|
||||
// First session
|
||||
const firstResult = await runCLI(context, {
|
||||
args: ["-p", "first message", "--config", context.configPath],
|
||||
args: ["-p", "--config", context.configPath, "first message"],
|
||||
env: {
|
||||
CONTINUE_CLI_TEST_SESSION_ID: sessionId
|
||||
},
|
||||
|
|
@ -141,7 +141,7 @@ describe("E2E: Resume Flag", () => {
|
|||
|
||||
// Resume and add a new message with the SAME session ID
|
||||
const resumeResult = await runCLI(context, {
|
||||
args: ["--resume", "-p", "second message", "--config", context.configPath],
|
||||
args: ["--resume", "-p", "--config", context.configPath, "second message"],
|
||||
env: {
|
||||
CONTINUE_CLI_TEST_SESSION_ID: sessionId
|
||||
},
|
||||
|
|
|
|||
|
|
@ -84,12 +84,12 @@ export async function runCLI(
|
|||
timeout,
|
||||
reject: false,
|
||||
input,
|
||||
// Force Windows to use the correct stdout/stderr handling
|
||||
windowsVerbatimArguments: true,
|
||||
// Ensure proper encoding
|
||||
encoding: 'utf8' as const,
|
||||
// Increase buffer size for Windows
|
||||
maxBuffer: 10 * 1024 * 1024, // 10MB
|
||||
// Let execa handle Windows argument escaping automatically
|
||||
windowsHide: true,
|
||||
};
|
||||
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue