mirror of
https://github.com/konvajs/konva.git
synced 2025-04-05 20:48:28 +08:00
21 lines
461 B
JavaScript
21 lines
461 B
JavaScript
function equal(val1, val2, message) {
|
|
if (val1 !== val2) {
|
|
throw new Error('Not passed: ' + message);
|
|
}
|
|
}
|
|
|
|
// try to import only core
|
|
let Konva = require('../lib/Core');
|
|
|
|
// no external shapes
|
|
equal(Konva.Rect, undefined, 'no external shapes');
|
|
|
|
let Rect = require('../lib/shapes/Rect').Rect;
|
|
|
|
equal(Rect !== undefined, true, 'Rect is defined');
|
|
|
|
// now import from package.json
|
|
let NewKonva = require('../');
|
|
|
|
equal(NewKonva.Rect, Rect, 'Same rects');
|