companion-oauth-flow-bind.test.mjs
21 lines 734 B
Raw
sha256:bd1eb24434d281fe65142038c1bf217493421f5a86880c22dff7e6037d2d4700 feat(companion): add production macOS distribution path Human minor ⚠ breaking 24 days ago
1 import assert from 'node:assert/strict';
2 import { EventEmitter } from 'node:events';
3 import test from 'node:test';
4
5 import { createOAuthRedirectAttempt } from '../lib/companion-oauth-flow.mjs';
6
7 test('loopback bind failure closes the attempt without retaining the callback timeout', async () => {
8 const server = new EventEmitter();
9 server.listening = false;
10 server.listen = () => queueMicrotask(() => server.emit('error', new Error('denied')));
11 server.close = () => {};
12 await assert.rejects(
13 createOAuthRedirectAttempt({
14 expectedState: 'state',
15 expectedIssuer: 'https://mcp.knowtation.store/api/v1/auth/native',
16 timeoutMs: 120_000,
17 createServer: () => server,
18 }),
19 /bind_failed/,
20 );
21 });
File History 1 commit
sha256:bd1eb24434d281fe65142038c1bf217493421f5a86880c22dff7e6037d2d4700 feat(companion): add production macOS distribution path Human minor ⚠ 24 days ago