text: "use strict";
  // Licensed to the Software Freedom Conservancy (SFC) under one
  // or more contributor license agreements.  See the NOTICE file
  // distributed with this work for additional information
  // regarding copyright ownership.  The SFC licenses this file
  // to you under the Apache License, Version 2.0 (the
  // "License"); you may not use this file except in compliance
  // with the License.  You may obtain a copy of the License at
  //
  //   http://www.apache.org/licenses/LICENSE-2.0
  //
  // Unless required by applicable law or agreed to in writing,
  // software distributed under the License is distributed on an
  // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  // KIND, either express or implied.  See the License for the
  // specific language governing permissions and limitations
  // under the License.
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
      if (k2 === undefined) k2 = k;
      Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  }) : (function(o, m, k, k2) {
      if (k2 === undefined) k2 = k;
      o[k2] = m[k];
  }));
  var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
      Object.defineProperty(o, "default", { enumerable: true, value: v });
  }) : function(o, v) {
      o["default"] = v;
  });
  var __importStar = (this && this.__importStar) || function (mod) {
      if (mod && mod.__esModule) return mod;
      var result = {};
      if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
      __setModuleDefault(result, mod);
      return result;
  };
  var __importDefault = (this && this.__importDefault) || function (mod) {
      return (mod && mod.__esModule) ? mod : { "default": mod };
  };
  Object.defineProperty(exports, "__esModule", { value: true });
  const os = __importStar(require("os"));
  const nock_1 = __importDefault(require("nock"));
  const resolve_driver_1 = require("../src/resolve-driver");
  describe('resolve-driver', () => {
      describe('resolveDriverUrl', () => {
          it('should resolve a download link of an electron driver', async () => {
              expect(await resolve_driver_1.resolveDriverUrl({
                  browser: 'electron',
                  platform: os.platform(),
                  arch: os.arch(),
                  version: '6.0.9',
              })).toBe(`https://github.com/electron/electron/releases/download/v6.0.9/chromedriver-v6.0.9-${os.platform}-${os.arch()}.zip`);
          });
          it('should resolve a download link of a chrome driver', async () => {
              const scope = nock_1.default('https://chromedriver.storage.googleapis.com')
                  .get('/LATEST_RELEASE_78')
                  .reply(200, '78.0.3904.11');
              expect(await resolve_driver_1.resolveDriverUrl({
                  browser: 'chrome',
                  platform: 'darwin',
                  arch: os.arch(),
                  version: '78.0.3904.11',
              })).toBe('https://chromedriver.storage.googleapis.com/78.0.3904.11/chromedriver_mac64.zip');
              scope.done();
          });
          it('should resolve a download link of a firefox driver', async () => {
              expect(await resolve_driver_1.resolveDriverUrl({
                  browser: 'firefox',
                  platform: 'darwin',
                  arch: os.arch(),
                  version: '59.0',
              })).toBe('https://github.com/mozilla/geckodriver/releases/download/v0.25.0/geckodriver-v0.25.0-macos.tar.gz');
              expect(await resolve_driver_1.resolveDriverUrl({
                  browser: 'firefox',
                  platform: 'darwin',
                  arch: os.arch(),
                  version: '70.0',
              })).toBe('https://github.com/mozilla/geckodriver/releases/download/v0.26.0/geckodriver-v0.26.0-macos.tar.gz');
          });
      });
      describe('resolveDriverName', () => {
          it('should resolve a driver name for mac (POSIX based)', () => {
              expect(resolve_driver_1.resolveDriverName({
                  browser: 'electron',
                  platform: 'darwin',
                  version: '6.0.9',
              })).toBe('chromedriver-v6.0.9');
          });
          it('should resolve a driver name for Windows', () => {
              expect(resolve_driver_1.resolveDriverName({
                  browser: 'electron',
                  platform: 'win32',
                  version: '6.0.9',
              })).toBe('chromedriver-v6.0.9.exe');
          });
      });
  });
  