Files
konva/test/import-test.mjs

19 lines
453 B
JavaScript
Raw Normal View History

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