@bhooai/nexus-ai-client 2.0.15 → 2.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/tests/ai-client.test.ts +7 -10
package/package.json
CHANGED
package/tests/ai-client.test.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { describe, it, expect, afterEach,
|
|
1
|
+
import { describe, it, expect, afterEach, vi } from 'vitest';
|
|
2
2
|
import { createServer, type Server, type IncomingMessage, type ServerResponse } from 'node:http';
|
|
3
3
|
import { AiClient, AiError } from '../src/index.js';
|
|
4
4
|
import type { ChatCompletionChunk } from '../src/index.js';
|
|
@@ -44,15 +44,12 @@ afterEach(() => {
|
|
|
44
44
|
servers = [];
|
|
45
45
|
});
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
if (PREV_LICENSE === undefined) delete process.env.NEXUS_LICENSE_KEY;
|
|
54
|
-
else process.env.NEXUS_LICENSE_KEY = PREV_LICENSE;
|
|
55
|
-
});
|
|
47
|
+
// The license gate is verified at app boot (ensureLicense); these tests exercise
|
|
48
|
+
// the client itself, so stub the gate.
|
|
49
|
+
vi.mock('@bhooai/nexus-crypto', () => ({
|
|
50
|
+
requireLicense: () => {},
|
|
51
|
+
LicenseError: class LicenseError extends Error {},
|
|
52
|
+
}));
|
|
56
53
|
|
|
57
54
|
describe('AiClient', () => {
|
|
58
55
|
it('chat (non-stream) parses the response', async () => {
|