1 |
|
2 |
|
3 | var CodeGradX = require('../codegradxlib.js');
|
4 |
|
5 | describe('CodeGradX', function () {
|
6 |
|
7 | it("converts xml to js", function (done) {
|
8 | function faildone (reason) {
|
9 | state.debug('faildone', reason).show();
|
10 | fail(reason);
|
11 | done();
|
12 | }
|
13 | var xml1 = "<a aa='bb' cc='1'></a>";
|
14 | CodeGradX.parsexml(xml1).then(function (js) {
|
15 |
|
16 | expect(js.a.$.aa).toBe('bb');
|
17 | expect(js.a.$.cc).toBe('1');
|
18 | done();
|
19 | }, faildone);
|
20 | var xml2 = "<a aa='bb' cc='1' />";
|
21 | CodeGradX.parsexml(xml2).then(function (js) {
|
22 |
|
23 | expect(js.a.$.aa).toBe('bb');
|
24 | expect(js.a.$.cc).toBe('1');
|
25 | done();
|
26 | }, faildone);
|
27 | });
|
28 |
|
29 | });
|