feat(flight-finder): implement milestone M1 - domain model and skill contract
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 164 B |
|
After Width: | Height: | Size: 167 B |
|
After Width: | Height: | Size: 138 B |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 126 B |
|
After Width: | Height: | Size: 254 B |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 595 B |
|
After Width: | Height: | Size: 315 B |
|
After Width: | Height: | Size: 361 B |
|
After Width: | Height: | Size: 302 B |
|
After Width: | Height: | Size: 145 B |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 184 B |
|
After Width: | Height: | Size: 429 B |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
@@ -0,0 +1,23 @@
|
||||
const PNGNode = require('../png-node');
|
||||
const fs = require('fs');
|
||||
|
||||
const files = fs.readdirSync('test/images');
|
||||
|
||||
function getImgData(Ctor, fileName) {
|
||||
const image = new Ctor(fs.readFileSync(`test/images/${fileName}`));
|
||||
return image.imgData;
|
||||
}
|
||||
|
||||
describe('imgData', () => {
|
||||
describe('node', () => {
|
||||
test.each(files)('%s', fileName => {
|
||||
expect(getImgData(PNGNode, fileName)).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
||||
describe('browser', () => {
|
||||
test.each(files)('%s', fileName => {
|
||||
expect(getImgData(PNG, fileName)).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,24 @@
|
||||
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();
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
HTMLCanvasElement.prototype.getContext = function() {};
|
||||
@@ -0,0 +1,29 @@
|
||||
const PNGNode = require('../png-node');
|
||||
const fs = require('fs');
|
||||
|
||||
const files = fs.readdirSync('test/images');
|
||||
|
||||
async function getPixels(Ctor, fileName) {
|
||||
const image = new Ctor(fs.readFileSync(`test/images/${fileName}`));
|
||||
return new Promise(resolve => {
|
||||
Ctor === PNGNode
|
||||
? image.decodePixels(resolve)
|
||||
: resolve(image.decodePixels());
|
||||
});
|
||||
}
|
||||
|
||||
describe('pixels', () => {
|
||||
describe('node', () => {
|
||||
test.each(files)('%s', async fileName => {
|
||||
const pixels = await getPixels(PNGNode, fileName);
|
||||
expect(pixels).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
||||
describe('browser', () => {
|
||||
test.each(files)('%s', async fileName => {
|
||||
const pixels = await getPixels(PNG, fileName);
|
||||
expect(pixels).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
});
|
||||