mirror of
https://github.com/status-im/react-native.git
synced 2025-01-15 20:15:11 +00:00
3360999431
Reviewed By: cpojer Differential Revision: D5190858 fbshipit-source-id: d3125cf81427dbbe3362ef1f958413394a6dc51d
26 lines
585 B
JavaScript
26 lines
585 B
JavaScript
/**
|
|
* Copyright 2004-present Facebook. All Rights Reserved.
|
|
*/
|
|
'use strict';
|
|
|
|
jest.enableAutomock().unmock('WebSocket');
|
|
jest.setMock('NativeModules', {
|
|
WebSocketModule: {
|
|
connect: () => {}
|
|
}
|
|
});
|
|
|
|
var WebSocket = require('WebSocket');
|
|
|
|
describe('WebSocket', function() {
|
|
|
|
it('should have connection lifecycle constants defined on the class', () => {
|
|
expect(WebSocket.CONNECTING).toEqual(0);
|
|
});
|
|
|
|
it('should have connection lifecycle constants defined on the instance', () => {
|
|
expect(new WebSocket('wss://echo.websocket.org').CONNECTING).toEqual(0);
|
|
});
|
|
|
|
});
|