Skip to content

Commit

Permalink
remove tests too
Browse files Browse the repository at this point in the history
  • Loading branch information
fippo committed Mar 24, 2024
1 parent 1d2d87f commit 9235cdd
Showing 1 changed file with 0 additions and 51 deletions.
51 changes: 0 additions & 51 deletions test/unit/chrome.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,6 @@ RTCLegacyStatsReport.prototype.stat = function(name) {
return this._data[name];
};

function makeLegacyStatsReport(type, data) {
const report = new RTCLegacyStatsReport();
report.type = type;
report._data = data;
return report;
}

describe('Chrome shim', () => {
const shim = require('../../dist/chrome/chrome_shim');
let window;
Expand All @@ -42,50 +35,6 @@ describe('Chrome shim', () => {
};
});

describe('legacy getStats', () => {
let pc;
beforeEach(() => {
window.RTCPeerConnection.prototype.getStats = function(cb) {
setTimeout(cb, 0, {
result: () => [
makeLegacyStatsReport('localcandidate', {
portNumber: '31337',
ipAddress: '8.8.8.8',
transport: 'udp',
candidateType: 'host',
priority: '12345'
}),
]
});
};
shim.shimGetStats(window);
pc = new window.RTCPeerConnection();
});

it('returns a promise', () => {
return pc.getStats();
});

it('returns chrome legacy getStats when called with a callback', (done) => {
pc.getStats((result) => {
expect(result).toHaveProperty('result');
const report = result.result()[0];
expect(report).toHaveProperty('id');
expect(report).toHaveProperty('type');
expect(report).toHaveProperty('timestamp');
expect(report).toHaveProperty('stat');
done();
});
});

it('is translated into a Map', () => {
return pc.getStats()
.then(result => {
expect(result).toBeInstanceOf(Map);
});
});
});

describe('PeerConnection shim', () => {
it('fail silently if RTCPeerConnection is not present', () => {
window = {};
Expand Down

0 comments on commit 9235cdd

Please sign in to comment.