diff --git a/polyfill/RTCPeerConnection.js b/polyfill/RTCPeerConnection.js index be9913b..763cdd4 100644 --- a/polyfill/RTCPeerConnection.js +++ b/polyfill/RTCPeerConnection.js @@ -4,11 +4,11 @@ import RTCDataChannel from './RTCDataChannel.js'; import RTCIceCandidate from './RTCIceCandidate.js'; import { RTCDataChannelEvent, RTCPeerConnectionIceEvent } from './Events.js'; import RTCSctpTransport from './RTCSctpTransport.js'; -import DOMException from 'node-domexception'; +import 'node-domexception'; export default class _RTCPeerConnection extends EventTarget { static async generateCertificate() { - throw new Error('Not implemented'); + throw new DOMException('Not implemented'); } #peerConnection; @@ -192,10 +192,6 @@ export default class _RTCPeerConnection extends EventTarget { return this.#peerConnection.signalingState(); } - static generateCertificate(keygenAlgorithm) { - throw new DOMException('Not implemented'); - } - async addIceCandidate(candidate) { if (candidate == null || candidate.candidate == null) { throw new DOMException('Candidate invalid'); diff --git a/test/jest-tests/polyfill.test.js b/test/jest-tests/polyfill.test.js new file mode 100644 index 0000000..5873a0a --- /dev/null +++ b/test/jest-tests/polyfill.test.js @@ -0,0 +1,10 @@ +import { expect } from '@jest/globals'; +import polyfill from '../../polyfill/index.js'; + +describe('polyfill', () => { + test('generateCertificate should throw', () => { + expect(async () => { + await polyfill.RTCPeerConnection.generateCertificate({}); + }).rejects.toEqual(new DOMException('Not implemented')); + }); +});