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.
24 lines
617 B
24 lines
617 B
const PNGNode = require('../png-node');
|
|
const fs = require('fs');
|
|
|
|
const files = fs.readdirSync('test/images');
|
|
|
|
function getMetaData(Ctor, fileName) {
|
|
const image = new Ctor(fs.readFileSync(`test/images/${fileName}`));
|
|
const { imgData, data, ...metadata } = image;
|
|
return metadata;
|
|
}
|
|
|
|
describe('metadata', () => {
|
|
describe('node', () => {
|
|
test.each(files)('%s', fileName => {
|
|
expect(getMetaData(PNGNode, fileName)).toMatchSnapshot();
|
|
});
|
|
});
|
|
|
|
describe('browser', () => {
|
|
test.each(files)('%s', fileName => {
|
|
expect(getMetaData(PNG, fileName)).toMatchSnapshot();
|
|
});
|
|
});
|
|
});
|