test: Add integration testing (#131)

* docs: Update description
* deps: Add nock
* chore: Add resolveJsonModule
* test: Add integration testing
* chore: Add @typescript-eslint/eslint-plugin
* refactor: Fix lint errors
* chore: Add eslint-plugin-jest
* refactor: Fix lint errors
* test: Add remove working files
* ci: Comment out cache steps
This commit is contained in:
Shohei Ueda
2020-01-18 10:29:06 +09:00
committed by GitHub
parent 477d977a96
commit 386980e22b
16 changed files with 1249 additions and 96 deletions

View File

@@ -1,7 +1,7 @@
import fetch from 'node-fetch';
export function getURL(org: string, repo: string, api: string): string {
let url: string = '';
let url = '';
if (api === 'brew') {
url = `https://formulae.brew.sh/api/formula/${repo}.json`;
@@ -21,7 +21,7 @@ export async function getLatestVersion(
const url = getURL(org, repo, api);
const response = await fetch(url);
const json = await response.json();
let latestVersion: string = '';
let latestVersion = '';
if (api === 'brew') {
latestVersion = json.versions.stable;
} else if (api === 'github') {