text: /**
   * Tests setting up an ngrok tunnel
   *
   */
  'use strict';
  
  function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; }
  
  jest.useRealTimers();
  jasmine.DEFAULT_TIMEOUT_INTERVAL = 60000;
  
  const request = require('request');
  const path = require('path');
  
  const xdl = require('../xdl');
  
  describe('ngrok', () => {
    xit('starts running and serves manifest', _asyncToGenerator(function* () {
      let projectRoot = path.resolve(__dirname, '../../../../apps/new-project-template');
      yield xdl.Project.startAsync(projectRoot);
      let ngrokUrl = yield xdl.Project.getUrlAsync(projectRoot, {
        urlType: 'http',
        hostType: 'tunnel'
      });
      if (!ngrokUrl) {
        throw new Error("ngrok didn't return a URL");
      }
      let response = yield request.promise.get(ngrokUrl);
      if (!response.body) {
        throw new Error("Didn't get expected manifest response");
      }
      let responseValue = JSON.parse(response.body);
      if (responseValue.error || response.statusCode !== 200) {
        throw new Error('Server responded with an error: ' + responseValue.error);
      }
  
      console.log('Successfully fetched manifest through ngrok and everything seems OK');
  
      let bundleUrl = responseValue.bundleUrl;
      console.log(`Fetching bundle at ${bundleUrl}`);
      let bundleResponse = yield request.promise.get(bundleUrl);
      if (!bundleResponse.body || !bundleResponse.body.includes('sourceMappingURL')) {
        throw new Error("Didn't get expected bundle response");
      }
  
      if (bundleResponse.statusCode !== 200) {
        throw new Error('Packager responded with bad status code: ' + bundleResponse.statusCode);
      }
  
      yield xdl.Project.stopAsync(projectRoot);
    }));
  });
  //# sourceMappingURL=../__sourcemaps__/__integration_tests__/Ngrok-test.js.map
  