index_spec.js 1.08 KB
Newer Older
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
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const lib_1 = require("../lib");
const mockdriver_1 = require("./mockdriver");
describe('extender', () => {
    it('should support setting/getting the network connection', (done) => {
        let ncType;
        let baseDriver = mockdriver_1.buildMockDriver('42', (name, method, path) => { }, (path, method, data) => {
            expect(path).toEqual('/session/42/network_connection');
            if (method == 'GET') {
                expect(Object.keys(data).length).toEqual(0);
                return ncType;
            }
            else if (method == 'POST') {
                expect(JSON.stringify(Object.keys(data))).toEqual('["type"]');
                ncType = data['type'];
            }
        });
        let driver = lib_1.extend(baseDriver);
        driver.setNetworkConnection(5).then(() => {
            return driver.getNetworkConnection();
        }).then((connectionType) => {
            expect(connectionType).toEqual(5);
            done();
        });
    });
});
//# sourceMappingURL=index_spec.js.map