forked from konvajs/konva
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnode-runner.js
130 lines (110 loc) · 3.69 KB
/
node-runner.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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
var fs = require('fs'),
Konva = require('../dist/konva-dev');
global.Konva = Konva;
Konva.enableTrace = true;
// Config MINIMAL test environment
global.suite = function(title, func) {
console.log('Suite : ' + title);
func();
};
global.test = function(title, func) {
try {
console.log('Run test: ' + title);
func(function(){});
} catch (e) {
console.log('Error at ' + title, e);
throw e;
}
};
test.skip = function(){};
global.assert = function(condtion, message){
if (!condtion) {
throw 'assert throw:' + message;
}
};
global.assert.equal = function(left, right){
if (left !== right) {
}
};
global.assert.notEqual = function(left, right){
if (left === right) {
throw 'assert throw';
}
};
global.addStage = function(){
return new Konva.Stage({
width: 578,
height: 200
});
};
// Some utils for testing
global.konvaContainer = Konva.document.createElement('div');
Konva.document.body.appendChild(konvaContainer);
global.showHit = global.addContainer = function(){
};
global.Image = Konva._nodeCanvas.Image;
Image.prototype.style = {};
eval(fs.readFileSync('./test/assets/tiger.js')+"");
eval(fs.readFileSync('./test/assets/worldMap.js')+"");
global.tiger = tiger;
global.worldMap = worldMap;
// now load all tests
require('./unit/Global-test.js');
require('./unit/Node-test.js');
require('./unit/Global-test.js');
require('./unit/Util-test.js');
require('./unit/Canvas-test.js');
require('./unit/Node-test.js');
require('./unit/Container-test.js');
require('./unit/Stage-test.js');
require('./unit/Layer-test.js');
require('./unit/Shape-test.js');
require('./unit/Collection-test.js');
// shapes -->
require('./unit/shapes/Rect-test.js');
require('./unit/shapes/Circle-test.js');
require('./unit/shapes/Image-test.js');
require('./unit/shapes/Line-test.js');
require('./unit/shapes/Text-test.js');
require('./unit/shapes/Blob-test.js');
require('./unit/shapes/Ellipse-test.js');
require('./unit/shapes/Polygon-test.js');
require('./unit/shapes/Spline-test.js');
require('./unit/shapes/Sprite-test.js');
require('./unit/shapes/Wedge-test.js');
require('./unit/shapes/Arc-test.js');
require('./unit/shapes/Ring-test.js');
// // extensions -->
require('./unit/Animation-test.js');
require('./unit/DragAndDrop-test.js');
require('./unit/Tween-test.js');
// // plugins -->
require('./unit/plugins/Label-test.js');
require('./unit/plugins/Star-test.js');
require('./unit/plugins/RegularPolygon-test.js');
require('./unit/plugins/Path-test.js');
require('./unit/plugins/TextPath-test.js');
// // filters -->
require('./unit/filters/Blur-test.js');
require('./unit/filters/Brighten-test.js');
require('./unit/filters/RGB-test.js');
require('./unit/filters/HSV-test.js');
require('./unit/filters/HSL-test.js');
require('./unit/filters/Invert-test.js');
require('./unit/filters/Mask-test.js');
require('./unit/filters/Grayscale-test.js');
require('./unit/filters/Enhance-test.js');
require('./unit/filters/Pixelate-test.js');
require('./unit/filters/Noise-test.js');
require('./unit/filters/Threshold-test.js');
require('./unit/filters/Posterize-test.js');
require('./unit/filters/Sepia-test.js');
require('./unit/filters/Emboss-test.js');
require('./unit/filters/Solarize-test.js');
require('./unit/filters/Kaleidoscope-test.js');
// //=============== functional tests ================-->
require('./functional/MouseEvents-test.js');
require('./functional/TouchEvents-test.js');
//require('./functional/DragAndDropEvents-test.js'); disabled because of simplest test configuration
// //=============== manual tests ================-->
// require('./manual/manual-test.js'); disabled because of unlimited animation