Path: blob/master/node_modules/@jimp/gif/test/gif.test.js
1126 views
import { Jimp, getTestDir } from '@jimp/test-utils';1import configure from '@jimp/custom';23import gif from '../src';45const jimp = configure({ types: [gif] }, Jimp);67describe('GIF', () => {8const imagesDir = getTestDir(__dirname) + '/images';910it('load GIF', async () => {11const image = await jimp.read(imagesDir + '/flower.gif');12image.getPixelColor(10, 10).should.be.equal(0xe5e6d9ff);13});1415it('load animated GIF', async () => {16const image = await jimp.read(imagesDir + '/animated.gif');17image.getPixelColor(10, 10).should.be.equal(0xa1d2f1ff);18});1920it('export GIF', async () => {21const jgd = await jimp.read(imagesDir + '/flower.gif');22const buffer = await jgd.getBufferAsync('image/gif');23buffer24.toString()25.startsWith('GIF')26.should.be.equal(true);27});28});293031