mirror of
https://github.com/status-im/react-native.git
synced 2025-01-09 09:12:02 +00:00
d363b1f2e2
Reviewed By: javache Differential Revision: D3229435 fb-gh-sync-id: b0e252d69e1f399a946fca6e98ef62ff44c2ef9c fbshipit-source-id: b0e252d69e1f399a946fca6e98ef62ff44c2ef9c
26 lines
568 B
JavaScript
26 lines
568 B
JavaScript
/**
|
|
* Copyright 2004-present Facebook. All Rights Reserved.
|
|
*/
|
|
'use strict';
|
|
|
|
jest.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);
|
|
});
|
|
|
|
});
|