Path: blob/master/node_modules/@jimp/plugin-shadow/test/shadow.test.js
1126 views
import { Jimp, mkJGD, getTestDir } from '@jimp/test-utils';1import configure from '@jimp/custom';2import resize from '@jimp/plugin-resize';3import blur from '@jimp/plugin-blur';45import shadow from '../src';67const jimp = configure({ plugins: [shadow, resize, blur] }, Jimp);89describe('Shadow', () => {10it('creates a shadow', async () => {11const expectedImg = await jimp.read(12getTestDir(__dirname) + '/images/shadow.png'13);14const testImage = await jimp.read(15mkJGD(16' ',17' ◆◆ ',18' ◆▦▦◆ ',19' ◆▦▦▦▦◆ ',20' ◆▦▦◆ ',21' ◆◆ ',22' '23)24);2526testImage27.shadow({ x: -1, y: 1, blur: 1 })28.bitmap.data.should.be.deepEqual(expectedImg.bitmap.data);29});30});313233