-
Notifications
You must be signed in to change notification settings - Fork 73
/
Copy pathtest.builder.js
50 lines (38 loc) · 1.33 KB
/
test.builder.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
49
50
describe("builder", function () {
var builder = require('cordova/builder');
it("includes the module into the target", function () {
var target = {},
objects = {
foo: {
path: "cordova/plugin/compass"
}
};
builder.build(objects).intoAndClobber(target);
expect(target.foo).toBeDefined();
expect(target.foo).toBe(require("cordova/plugin/compass"));
});
it("returns an empty object literal if no path", function () {
var target = {},
objects = {cat: {}};
builder.build(objects).intoButDontClobber(target);
expect(target.cat).toBeDefined();
});
it("builds out the children", function () {
var target = {},
objects = {
homer: {
children: {
bart: {},
lisa: {},
maggie: {
path: "cordova/plugin/compass"
}
}
}
};
builder.build(objects).intoButDontClobber(target);
expect(target.homer.bart).toBeDefined();
expect(target.homer.maggie).toBe(require('cordova/plugin/compass'));
expect(target.homer.lisa).toBeDefined();
});
});