"use strict";

var _nock = _interopRequireDefault(require("nock"));

var _fetchPackageInfo = _interopRequireDefault(require("./fetchPackageInfo"));

var _package = _interopRequireDefault(require("../../../package.json"));

var _config = require("../../config");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

describe('Fetch Package Info', () => {
  test('should fail if request doesn\'t return 200', async () => {
    const appName = _package.default.name;
    const url = `${_config.API_ENDPOINTS_NPMS_PACKAGE}`;
    (0, _nock.default)(url).get(`/${appName}`).replyWithError('test error');

    try {
      await (0, _fetchPackageInfo.default)();
    } catch (e) {
      expect(e).toBeTruthy();
    }
  });
});