index_spec.js 1.1 KB

12345678910111213141516171819202122232425262728
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. const lib_1 = require("../lib");
  4. const mockdriver_1 = require("./mockdriver");
  5. describe('extender', () => {
  6. it('should support setting/getting the network connection', (done) => {
  7. let ncType;
  8. let baseDriver = mockdriver_1.buildMockDriver('42', (name, method, path) => { }, (path, method, data) => {
  9. expect(path).toEqual('/session/42/network_connection');
  10. if (method == 'GET') {
  11. expect(Object.keys(data).length).toEqual(0);
  12. return ncType;
  13. }
  14. else if (method == 'POST') {
  15. expect(JSON.stringify(Object.keys(data))).toEqual('["type"]');
  16. ncType = data['type'];
  17. }
  18. });
  19. let driver = lib_1.extend(baseDriver);
  20. driver.setNetworkConnection(5).then(() => {
  21. return driver.getNetworkConnection();
  22. }).then((connectionType) => {
  23. expect(connectionType).toEqual(5);
  24. done();
  25. });
  26. });
  27. });
  28. //# sourceMappingURL=index_spec.js.map