1
0
mirror of https://github.com/lrsjng/pagemap.git synced 2025-08-10 23:13:59 +02:00
This commit is contained in:
Lars Jung
2019-04-28 15:05:21 +02:00
parent a05a11d795
commit d76b3c4dd5
8 changed files with 187 additions and 178 deletions

View File

@@ -1,12 +1,24 @@
const {test, assert} = require('scar');
const pagemap = require('../src/pagemap');
if (!global.window) {
global.window = new (require('jsdom')).JSDOM().window;
}
const {test, assert} = require('scar');
const pagemap = require('../src/pagemap');
test('access', () => {
assert.equal(typeof pagemap, 'function');
});
test('no canvas throws', () => {
assert.throws(() => pagemap(), /getContext/);
assert.throws(() => pagemap(true), /getContext/);
assert.throws(() => pagemap({}, {}), /getContext/);
});
// test('basic canvas', () => {
// const canvas = global.window.document.createElement('canvas');
// const res = pagemap(canvas);
// assert.equal(typeof res, 'object');
// });
test.cli();