Skip to content

Commit 4df4b3b

Browse files
committed
fix: formatting
1 parent 80620dc commit 4df4b3b

File tree

3 files changed

+34
-19
lines changed

3 files changed

+34
-19
lines changed

source/ai-sdk-client-error-handling.spec.ts

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ test('parseAPIError - handles Ollama unmarshal error from issue #87', t => {
2121
});
2222

2323
test('parseAPIError - handles unmarshal error without retry wrapper', t => {
24-
const error = new Error("unmarshal: invalid character '{' after top-level value");
24+
const error = new Error(
25+
"unmarshal: invalid character '{' after top-level value",
26+
);
2527

2628
const result = parseAPIError(error);
2729

@@ -44,7 +46,9 @@ test('parseAPIError - handles 500 error with invalid character (status code take
4446
});
4547

4648
test('parseAPIError - handles 500 error without JSON parsing issue', t => {
47-
const error = new Error('500 Internal Server Error: database connection failed');
49+
const error = new Error(
50+
'500 Internal Server Error: database connection failed',
51+
);
4852

4953
const result = parseAPIError(error);
5054

@@ -85,30 +89,30 @@ test('parseAPIError - handles non-Error objects', t => {
8589
});
8690

8791
test('parseAPIError - handles context length errors', t => {
88-
const error = new Error(
89-
'context length exceeded',
90-
);
92+
const error = new Error('context length exceeded');
9193

9294
const result = parseAPIError(error);
9395

9496
// Use exact assertion instead of OR condition
95-
t.is(result, 'Context too large: Please reduce the conversation length or message size');
97+
t.is(
98+
result,
99+
'Context too large: Please reduce the conversation length or message size',
100+
);
96101
});
97102

98103
test('parseAPIError - handles too many tokens errors', t => {
99-
const error = new Error(
100-
'too many tokens in the request',
101-
);
104+
const error = new Error('too many tokens in the request');
102105

103106
const result = parseAPIError(error);
104107

105-
t.is(result, 'Context too large: Please reduce the conversation length or message size');
108+
t.is(
109+
result,
110+
'Context too large: Please reduce the conversation length or message size',
111+
);
106112
});
107113

108114
test('parseAPIError - handles 400 with context length in message', t => {
109-
const error = new Error(
110-
'400 Bad Request: context length exceeded',
111-
);
115+
const error = new Error('400 Bad Request: context length exceeded');
112116

113117
const result = parseAPIError(error);
114118

@@ -137,7 +141,10 @@ test('parseAPIError - handles 429 rate limit error', t => {
137141

138142
const result = parseAPIError(error);
139143

140-
t.is(result, 'Rate limit exceeded: Too many requests. Please wait and try again');
144+
t.is(
145+
result,
146+
'Rate limit exceeded: Too many requests. Please wait and try again',
147+
);
141148
});
142149

143150
test('parseAPIError - handles 502 bad gateway error', t => {
@@ -161,11 +168,16 @@ test('parseAPIError - handles reduce tokens message', t => {
161168

162169
const result = parseAPIError(error);
163170

164-
t.is(result, 'Too many tokens: Please shorten your message or clear conversation history');
171+
t.is(
172+
result,
173+
'Too many tokens: Please shorten your message or clear conversation history',
174+
);
165175
});
166176

167177
test('parseAPIError - cleans up unknown errors', t => {
168-
const error = new Error('Error: Something unexpected happened\nWith more details');
178+
const error = new Error(
179+
'Error: Something unexpected happened\nWith more details',
180+
);
169181

170182
const result = parseAPIError(error);
171183

source/commands/lsp-command.spec.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ test('LSP command: shows no servers when none connected', t => {
6262
t.truthy(output);
6363
t.regex(output!, /No LSP servers connected/);
6464
t.regex(output!, /agents\.config\.json/);
65-
t.regex(output!, /LSP servers will auto-discover based on your project files/);
65+
t.regex(
66+
output!,
67+
/LSP servers will auto-discover based on your project files/,
68+
);
6669
});
6770

6871
test('LSP command: displays server status correctly', t => {
@@ -275,4 +278,4 @@ test('lspCommand handler returns React element when no servers connected', async
275278

276279
t.truthy(result);
277280
t.true(React.isValidElement(result));
278-
});
281+
});

source/commands/lsp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,4 +120,4 @@ export const lspCommand: Command = {
120120
}),
121121
);
122122
},
123-
};
123+
};

0 commit comments

Comments
 (0)