diff --git a/libraries/WebRTC/Emitter.test.ts b/libraries/WebRTC/Emitter.test.ts new file mode 100644 index 0000000000..7541217306 --- /dev/null +++ b/libraries/WebRTC/Emitter.test.ts @@ -0,0 +1,30 @@ +import * as Emitter from '~/libraries/WebRTC/Emitter' + +describe('Emitter.default.on', () => { + let inst: any + + beforeEach(() => { + inst = new Emitter.default() + }) + + test('0', () => { + const result: any = inst.on( + 'data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%22undefined%22%20height%3D%22undefined%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22grey%22%2F%3E%3Ctext%20x%3D%22NaN%22%20y%3D%22NaN%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3Eundefinedxundefined%3C%2Ftext%3E%3C%2Fsvg%3E', + false, + ) + expect(result).toMatchSnapshot() + }) + + test('1', () => { + const result: any = inst.on( + 'data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%22undefined%22%20height%3D%22undefined%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22grey%22%2F%3E%3Ctext%20x%3D%22NaN%22%20y%3D%22NaN%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3Eundefinedxundefined%3C%2Ftext%3E%3C%2Fsvg%3E', + true, + ) + expect(result).toMatchSnapshot() + }) + + test('2', () => { + const result: any = inst.on('', true) + expect(result).toMatchSnapshot() + }) +}) diff --git a/libraries/WebRTC/Libp2p.test.ts b/libraries/WebRTC/Libp2p.test.ts new file mode 100644 index 0000000000..e79cbd77ea --- /dev/null +++ b/libraries/WebRTC/Libp2p.test.ts @@ -0,0 +1,8 @@ +import * as Libp2p from '~/libraries/WebRTC/Libp2p' + +describe('Libp2p.Peer2Peer.getInstance', () => { + test('0', () => { + const result: any = Libp2p.Peer2Peer.getInstance() + expect(result).toMatchSnapshot() + }) +}) diff --git a/libraries/WebRTC/__snapshots__/Emitter.test.ts.snap b/libraries/WebRTC/__snapshots__/Emitter.test.ts.snap new file mode 100644 index 0000000000..722460d87f --- /dev/null +++ b/libraries/WebRTC/__snapshots__/Emitter.test.ts.snap @@ -0,0 +1,7 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Emitter.default.on 0 1`] = `undefined`; + +exports[`Emitter.default.on 1 1`] = `undefined`; + +exports[`Emitter.default.on 2 1`] = `undefined`; diff --git a/libraries/WebRTC/__snapshots__/Libp2p.test.ts.snap b/libraries/WebRTC/__snapshots__/Libp2p.test.ts.snap new file mode 100644 index 0000000000..dc61c92aca --- /dev/null +++ b/libraries/WebRTC/__snapshots__/Libp2p.test.ts.snap @@ -0,0 +1,7 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Libp2p.Peer2Peer.getInstance 0 1`] = ` +Peer2Peer { + "_events": Object {}, +} +`;