Total Complexity | 4 |
Complexity/F | 0 |
Lines of Code | 18 |
Function Count | 0 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import mockServer from '../mock/server' |
||
2 | import { test } from '../suite' |
||
3 | import WebSocketClient from '../../src/WSC' |
||
4 | |||
5 | /** Ready method. */ |
||
6 | test('No native throws without an adapter', async () => { |
||
7 | const {port} = await mockServer() |
||
8 | let pass = false |
||
9 | try { |
||
10 | new WebSocketClient({ url: 'ws://127.0.0.1:' + port }) |
||
11 | try { |
||
12 | if(WebSocket) pass = true |
||
13 | } catch {} |
||
14 | } catch { |
||
15 | pass=true |
||
16 | } |
||
17 | if(!pass) throw new Error('Does not throw.') |
||
18 | }) |