You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
570 B
23 lines
570 B
const PNGNode = require('../png-node');
|
|
const fs = require('fs');
|
|
|
|
const files = fs.readdirSync('test/images');
|
|
|
|
function getImgData(Ctor, fileName) {
|
|
const image = new Ctor(fs.readFileSync(`test/images/${fileName}`));
|
|
return image.imgData;
|
|
}
|
|
|
|
describe('imgData', () => {
|
|
describe('node', () => {
|
|
test.each(files)('%s', fileName => {
|
|
expect(getImgData(PNGNode, fileName)).toMatchSnapshot();
|
|
});
|
|
});
|
|
|
|
describe('browser', () => {
|
|
test.each(files)('%s', fileName => {
|
|
expect(getImgData(PNG, fileName)).toMatchSnapshot();
|
|
});
|
|
});
|
|
});
|