avocado/packages/graphics/test/image.js

19 lines
449 B
JavaScript
Raw Normal View History

2022-03-11 05:08:59 -06:00
import {expect} from 'chai';
2021-01-02 22:01:57 -06:00
2021-05-09 18:13:18 -05:00
import Image from '../src/image';
2021-01-02 22:01:57 -06:00
Image.root = 'test/fixtures';
2021-01-05 11:25:37 -06:00
describe('Image', () => {
2022-03-11 05:08:59 -06:00
it('has a sane default', async () => {
2021-01-05 11:25:37 -06:00
const image = new Image();
expect(image.height).to.equal(0);
expect(image.width).to.equal(0);
});
2022-03-11 05:08:59 -06:00
it('can load images', async () => {
2021-01-05 11:25:37 -06:00
const image = await Image.load('/test.png');
expect(image.height).to.equal(16);
expect(image.width).to.equal(16);
2021-01-02 22:01:57 -06:00
});
});