(s, expected)
| 8 | describes.sandboxed('DOM - srcset', {}, () => { |
| 9 | describe('parseSrcset', () => { |
| 10 | function test(s, expected) { |
| 11 | const res = parseSrcset(s); |
| 12 | expect(res.sources_.length).to.equal(expected.length); |
| 13 | for (let i = 0; i < expected.length; i++) { |
| 14 | const r = res.sources_[i]; |
| 15 | const e = expected[i]; |
| 16 | expect(r.url).to.equal(e.url); |
| 17 | expect(r.width).to.equal(e.width); |
| 18 | expect(r.dpr).to.equal(e.dpr); |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | it('should accept single source, default to 1px', () => { |
| 23 | test(' \n image \n ', [{url: 'image', dpr: 1}]); |
no test coverage detected