1 | /*
|
2 | * Licensed to Cloudkick, Inc ('Cloudkick') under one or more
|
3 | * contributor license agreements. See the NOTICE file distributed with
|
4 | * this work for additional information regarding copyright ownership.
|
5 | * Cloudkick licenses this file to You under the Apache License, Version 2.0
|
6 | * (the "License"); you may not use this file except in compliance with
|
7 | * the License. You may obtain a copy of the License at
|
8 | *
|
9 | * http://www.apache.org/licenses/LICENSE-2.0
|
10 | *
|
11 | * Unless required by applicable law or agreed to in writing, software
|
12 | * distributed under the License is distributed on an "AS IS" BASIS,
|
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14 | * See the License for the specific language governing permissions and
|
15 | * limitations under the License.
|
16 | */
|
17 |
|
18 | var i = 0;
|
19 | var called = false;
|
20 | var n = 0;
|
21 |
|
22 | exports['not_called'] = function(test, assert) {
|
23 | assert.ok(false);
|
24 | test.finish();
|
25 | };
|
26 |
|
27 | exports['setUp'] = function(test, assert) {
|
28 | i = 9;
|
29 | called = true;
|
30 | n++;
|
31 | test.finish();
|
32 | };
|
33 |
|
34 | exports['test_indexOf'] = function(test, assert) {
|
35 | assert.ok(called);
|
36 | assert.equal('test'.indexOf('test'), 0);
|
37 | setTimeout(function() {
|
38 | n++;
|
39 | test.finish();
|
40 | }, 50);
|
41 | };
|
42 |
|
43 | exports['test_throw'] = function(test, assert) {
|
44 | assert.ok(called);
|
45 |
|
46 | try {
|
47 | throw new Error('test');
|
48 | }
|
49 | catch (err) {
|
50 | assert.ok(err);
|
51 | }
|
52 |
|
53 | n++;
|
54 | test.finish();
|
55 | };
|
56 |
|
57 | exports['tearDown'] = function(test, assert) {
|
58 | assert.ok(called);
|
59 | assert.equal(n, 3);
|
60 |
|
61 | test.finish();
|
62 | };
|