-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_standard_yuixhr_test_template.js
48 lines (41 loc) · 1.61 KB
/
test_standard_yuixhr_test_template.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
YUI.add('lp.testing.tests.test_standard_yuixhr_test_template', function (Y) {
// This is one-half of an example yuixhr test. The other half of a
// test like this is a file of the same name but with a .py
// extension. It holds the fixtures that this file uses for
// application setup and teardown. It also helps the Launchpad
// testrunner know how to run these tests. The actual tests are
// written here, in Javascript. The YUI namespace must match the Python
// module path.
// These tests are expensive to run. Keep them to a minimum,
// preferring pure JS unit tests and pure Python unit tests.
var serverfixture = Y.lp.testing.serverfixture;
// TODO: change this explanation string.
/**
* Test important things...
*/
var tests = Y.namespace('lp.testing.tests.test_standard_yuixhr_test_template');
// TODO: Change this string to match what you are doing.
tests.suite = new Y.Test.Suite('lp.testing.yuixhr Tests');
tests.suite.add(new Y.Test.Case({
// TODO: change this name.
name: 'Example tests',
tearDown: function() {
// Always do this.
serverfixture.teardown(this);
},
// Your tests go here.
test_example: function() {
// In this example, we care about the return value of the setup.
// Sometimes, you won't.
var data = serverfixture.setup(this, 'example');
// Now presumably you would test something, maybe like this.
var response = Y.io(
data.product.self_link,
{sync: true}
);
Y.Assert.areEqual(200, response.status);
}
}));
}, '0.1', {
requires: ['test', 'lp.testing.serverfixture']
});