-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.html
55 lines (49 loc) · 1.39 KB
/
test.html
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
<!doctype html>
<html>
<head>
<script src="Utils.js"></script>
<script>
"use strict";
var it = function (name, callback) {
console.log('my name is ', name);
console.log('starting callback');
callback(function(){console.log('test is done!', arguments);});
console.log('callback executed');
};
var jasmine = {
createSpy: function() {
return function(){console.log('I\'m a spy!!!');};
}
};
var expect = function(anything) {
console.log('expecting',anything);
return {
toEqual: function(eq) {
console.log('to be equal to', eq);
},
not: {
toHaveBeenCalled: function() { console.log('to not have been called'); }
}
};
};
var backend = {
expectGET: function(url) {
console.log('expecting get on',url);
return {
respond: function(code,data) {
console.log('I\'ll respond with code',code);
console.log('and data',data);
}
};
},
flush: function() {console.log('FLUSH!');}
};
</script>
<script>
"use strict";
var instance = new HttpProxyTester(backend,"http://localhost/",{test: function() {return new Promise(function(res,rej){res({status:512,data:"some data"});});}});
</script>
</head>
<body>
</body>
</html>