-
Notifications
You must be signed in to change notification settings - Fork 63
/
index.js
24 lines (19 loc) · 641 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const {test, assert} = require('scar');
const pagemap = require('../src/pagemap');
if (!global.window) {
global.window = new (require('jsdom')).JSDOM().window;
}
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();