-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtests.js
38 lines (37 loc) · 1.14 KB
/
tests.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
Tinytest.add('load ace', function (test) {
var ace = AceEditor.instance();
test.equal(ace, "loading ace");
});
Tinytest.add('wait ace to be loaded', function (test) {
var ace = AceEditor.instance();
test.equal(ace, "ace is being loaded");
});
Tinytest.addAsync('ace is loaded', function (test, completed) {
$("body").append("<pre id='editor' style='display:none'/>");
var ace = AceEditor.instance("editor",
{
theme:"dawn",
mode:"html"
},
function(editor){
//this is passed to the cb arg
test.equal(ace, "ace is being loaded");
ace = AceEditor.instance();
test.equal(ace.loaded,true);
test.instanceOf(editor, Object);
test.equal(editor.getTheme(),"ace/theme/dawn");
completed();
});
});
Tinytest.addAsync('testTracker', function (test,completed) {
AceEditor.unloadInstance();
$("body").append("<pre id='editor' style='display:none'/>");
Tracker.autorun(function (e) {
var editor = AceEditor.instance("editor");
console.log(editor);
if(editor.loaded===true){
e.stop();
completed();
}
});
});