mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 16:57:46 +00:00
fix: failed json-output tests
This commit is contained in:
@@ -12,13 +12,7 @@ describe('JSON output', () => {
|
|||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
rig = new TestRig();
|
rig = new TestRig();
|
||||||
await rig.setup('json-output-test', {
|
await rig.setup('json-output-test');
|
||||||
settings: {
|
|
||||||
security: {
|
|
||||||
authType: 'openai',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(async () => {
|
afterEach(async () => {
|
||||||
@@ -60,6 +54,7 @@ describe('JSON output', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should return a JSON error for enforced auth mismatch before running', async () => {
|
it('should return a JSON error for enforced auth mismatch before running', async () => {
|
||||||
|
const originalOpenaiApiKey = process.env['OPENAI_API_KEY'];
|
||||||
process.env['OPENAI_API_KEY'] = 'test-key';
|
process.env['OPENAI_API_KEY'] = 'test-key';
|
||||||
await rig.setup('json-output-auth-mismatch', {
|
await rig.setup('json-output-auth-mismatch', {
|
||||||
settings: {
|
settings: {
|
||||||
@@ -74,7 +69,7 @@ describe('JSON output', () => {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
thrown = e as Error;
|
thrown = e as Error;
|
||||||
} finally {
|
} finally {
|
||||||
delete process.env['OPENAI_API_KEY'];
|
process.env['OPENAI_API_KEY'] = originalOpenaiApiKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
expect(thrown).toBeDefined();
|
expect(thrown).toBeDefined();
|
||||||
|
|||||||
Reference in New Issue
Block a user