forked from GeoTIFF/geoblaze
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-loading-builds.js
More file actions
44 lines (39 loc) · 1.64 KB
/
test-loading-builds.js
File metadata and controls
44 lines (39 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
const { expect } = require('chai');
const puppeteer = require('puppeteer');
const url2GeoTIFF = 'http://localhost:3000/data/example_4326.tif';
describe('Loading Production Build', function() {
it('Should Successfully Require Production Build in Node', async () => {
const geoblaze = require('./dist/geoblaze.min.js');
expect(geoblaze).to.be.ok;
const georaster = await geoblaze.load(url2GeoTIFF);
const result = await geoblaze.median(georaster);
expect(result[0]).to.equal(132);
});
it('Should Successfully Load Production Build in the Browser', async () => {
const browser = await puppeteer.launch();
const url = `http://localhost:3000/test/test-production-build.html`;
const page = await browser.newPage();
await page.goto(url);
const result = await page.evaluate(() => window.promises.median);
expect(result[0]).to.equal(132);
browser.close();
});
});
describe('Loading Development Build', function() {
it('Should Successfully Require Development Build in Node', async () => {
const geoblaze = require('./dist/geoblaze.js');
expect(geoblaze).to.be.ok;
const georaster = await geoblaze.load(url2GeoTIFF);
const result = await geoblaze.median(georaster);
expect(result[0]).to.equal(132);
});
it('Should Successfully Load Development Build in the Browser', async () => {
const browser = await puppeteer.launch();
const url = `http://localhost:3000/test/test-dev-build.html`;
const page = await browser.newPage();
await page.goto(url);
const result = await page.evaluate(() => window.promises.median);
expect(result[0]).to.equal(132);
browser.close();
});
});