-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathspec_example.js
More file actions
40 lines (34 loc) · 1.06 KB
/
spec_example.js
File metadata and controls
40 lines (34 loc) · 1.06 KB
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
describe("A test", function(){
it("should pass sync", function(){ assert(true); });
it("should fail sync", function(){ assert(false); });
it("should pass async", function(promise){
promise.addCallback(function(){
assert(true);
})
setTimeout(function(){ promise.emitSuccess() }, 500);
});
it("should fail async", function(promise){
promise.addCallback(function(){
assert(false);
})
setTimeout(function(){ promise.emitSuccess() }, 500);
});
it("should fail a timeout", 300, function(promise){
promise.addCallback(function(){
assert(true);
})
setTimeout(function(){ promise.emitSuccess() }, 1000);
});
it("Should pass simple sync tests after async ones", function(){
assert(true);
});
it("should handle assertions for raised exceptions", function() {
assertRaise('SpectacularError', function() {
function SpectacularError(message) {
this.name = 'SpectacularError';
this.message = message;
};
throw new SpectacularError('this is just spectacular');
});
});
});