konva/test/import-test.mjs

19 lines
456 B
JavaScript
Raw Normal View History

function equal(val1, val2, message) {
if (val1 !== val2) {
throw new Error('Not passed: ' + message);
}
}
2025-08-10 21:10:55 +08:00
// try to import only core from built lib
2023-04-14 12:27:56 +08:00
import Konva from '../lib/Core.js';
2025-08-10 21:10:55 +08:00
import '../lib/setup-node-canvas.js';
2023-04-14 12:27:56 +08:00
import { Rect } from '../lib/shapes/Rect.js';
2023-04-14 12:27:56 +08:00
equal(Rect !== undefined, true, 'Rect is defined');
2023-04-14 12:27:56 +08:00
equal(Konva.Rect, Rect, 'Rect is injected');
2025-08-10 21:10:55 +08:00
// just do a simple action
2023-04-14 12:27:56 +08:00
const stage = new Konva.Stage();
stage.toDataURL();