to compare large files, for example. images when approving a file loads a comparison of buffers or strings with should.eql takes a lot of time. I recommend approving a hash of a head with a crypto module:
const buf1Hash = crypto.createHash('sha256').update(buf1).digest(); const buf2Hash = crypto.createHash('sha256').update(buf2).digest(); buf1Hash.should.eql(buf2Hash);
A simpler approach claims the length of the buffer as follows:
buf1.length.should.eql(buf2.length)
instead of using ifjs as an approval module you can use another tool
source share