Dynamic audio level indicator

This commit is contained in:
Fedor Indutny 2022-05-18 20:28:51 -07:00 committed by GitHub
parent ac59dec5aa
commit e6223b6a11
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 323 additions and 123 deletions

View file

@ -4,7 +4,7 @@
import { assert } from 'chai';
import * as sinon from 'sinon';
import { groupBy } from '../../util/mapUtil';
import { groupBy, isEqual } from '../../util/mapUtil';
describe('map utilities', () => {
describe('groupBy', () => {
@ -27,4 +27,45 @@ describe('map utilities', () => {
);
});
});
describe('isEqual', () => {
it('returns false on different maps', () => {
assert.isFalse(
isEqual<string, number>(new Map([]), new Map([['key', 1]]))
);
assert.isFalse(
isEqual<string, number>(new Map([['key', 0]]), new Map([['key', 1]]))
);
assert.isFalse(
isEqual<string, number>(
new Map([
['key', 1],
['another-key', 2],
]),
new Map([['key', 1]])
)
);
});
it('returns true on equal maps', () => {
assert.isTrue(isEqual<string, number>(new Map([]), new Map([])));
assert.isTrue(
isEqual<string, number>(new Map([['key', 1]]), new Map([['key', 1]]))
);
assert.isTrue(
isEqual<string, number>(
new Map([
['a', 1],
['b', 2],
]),
new Map([
['b', 2],
['a', 1],
])
)
);
});
});
});