"use strict";

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

var _getPkgInfo = _interopRequireDefault(require("./getPkgInfo"));

var _notifyLatestVersion = _interopRequireDefault(require("./notifyLatestVersion"));

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

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

describe('Notify Latest Version', () => {
  test('should not throw error on 500 response', async () => {
    const appName = (0, _getPkgInfo.default)().name;
    const url = `${_config.API_ENDPOINTS_NPMS_PACKAGE}`;
    (0, _nock.default)(url).get(`/${appName}`).reply(500);

    try {
      await (0, _notifyLatestVersion.default)();
    } catch (e) {
      expect(e).toBeFalsy();
    }
  });
});