PHP 8.2.30
Preview: metadata.spec.js Size: 617 B
/proc/thread-self/root/home/byroehnu/.trash/node_modules11/png-js/test/metadata.spec.js

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();
    });
  });
});

Directory Contents

Dirs: 2 × Files: 4

Name Size Perms Modified Actions
images DIR
- drwxr-xr-x 2026-02-14 19:20:32
Edit Download
- drwxr-xr-x 2026-02-14 19:21:06
Edit Download
570 B lrw-r--r-- 2026-02-14 19:19:14
Edit Download
617 B lrw-r--r-- 2026-02-14 19:19:14
Edit Download
56 B lrw-r--r-- 2026-02-14 19:19:14
Edit Download
766 B lrw-r--r-- 2026-02-14 19:19:14
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).