refactor: Fix lint errors

This commit is contained in:
peaceiris 2020-01-17 22:07:19 +00:00
parent 86d998acdc
commit ac375e4950
2 changed files with 22 additions and 26 deletions

View file

@ -1,11 +1,11 @@
import * as main from '../src/main';
const nock = require('nock');
import nock from 'nock';
// import {FetchError} from 'node-fetch';
import jsonTestBrew from './data/brew.json';
// import jsonTestGithub from './data/github.json';
jest.setTimeout(30000);
const repo: string = 'hugo';
const repo = 'hugo';
beforeEach(() => {
jest.resetModules();
@ -18,7 +18,7 @@ afterEach(() => {
describe('Integration testing run()', () => {
test('succeed in installing a custom version', async () => {
const testVersion: string = '0.61.0';
const testVersion = '0.61.0';
process.env['INPUT_HUGO-VERSION'] = testVersion;
const result: main.ActionResult = await main.run();
expect(result.exitcode).toBe(0);
@ -26,7 +26,7 @@ describe('Integration testing run()', () => {
});
test('succeed in installing the latest version', async () => {
const testVersion: string = 'latest';
const testVersion = 'latest';
process.env['INPUT_HUGO-VERSION'] = testVersion;
nock('https://formulae.brew.sh')
.get(`/api/formula/${repo}.json`)
@ -49,11 +49,8 @@ describe('showVersion()', () => {
expect(result.output).toMatch(/git version/);
});
test('return exception', async () => {
try {
result = await main.showVersion('gitgit', ['--version']);
} catch (e) {
expect(e).toThrow(Error);
}
test('return not found', async () => {
result = await main.showVersion('gitgit', ['--version']);
expect(result.exitcode).not.toBe(0);
});
});