forked from adamlaska/browser-compat-data
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathiter-support.test.js
More file actions
27 lines (22 loc) · 902 Bytes
/
iter-support.test.js
File metadata and controls
27 lines (22 loc) · 902 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
const assert = require('assert').strict;
const iterSupport = require('./iter-support');
describe('iterSupport()', function () {
it('returns a `"version_added": null` support statement for non-existent browsers', function () {
assert.deepEqual(iterSupport({ support: { firefox: [] } }, 'chrome'), [
{ version_added: null },
]);
});
it('returns a single support statement as an array', function () {
assert.deepEqual(
iterSupport({ support: { firefox: { version_added: true } } }, 'firefox'),
[{ version_added: true }],
);
});
it('returns an array of support statements as an array', function () {
const compatObj = {
support: { firefox: [{ version_added: true }, { version_added: '1' }] },
};
const support = [{ version_added: true }, { version_added: '1' }];
assert.deepEqual(iterSupport(compatObj, 'firefox'), support);
});
});