UNPKG

aft-web-services

Version:

Automated Functional Testing (AFT) module for testing web services over HTTP and HTTPS

25 lines 917 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const src_1 = require("../../src"); describe('HttpData', () => { it('can deserialise JSON data to Typed JavaScript object', () => { let response = { data: '{"bar":"sample", "baz":2}' }; let foo = src_1.httpData.as(response); expect(foo).toBeDefined(); expect(foo.bar).toEqual('sample'); expect(foo.baz).toEqual(2); }); it('can deserialise XML data to Document object', () => { let response = { headers: { "content-type": "text/xml" }, data: '<foo><bar>sample</bar><baz>2</baz></foo>' }; let yop = src_1.httpData.as(response); expect(yop).toBeDefined(); expect(yop.foo.bar.keyValue).toEqual('sample'); expect(yop.foo.baz.keyValue).toEqual(2); }); }); //# sourceMappingURL=http-data-spec.js.map