Skip to content

Commit

Permalink
ci: fix jest/got issue
Browse files Browse the repository at this point in the history
  • Loading branch information
autero1 committed Oct 23, 2022
1 parent cb464b4 commit 13cd122
Show file tree
Hide file tree
Showing 5 changed files with 10,012 additions and 5,785 deletions.
3 changes: 0 additions & 3 deletions .envrc

This file was deleted.

7 changes: 5 additions & 2 deletions __tests__/action.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import * as os from 'os';
import {getDownloadURL, getLatestVersion} from '../src/action';
import got from 'got';

import * as got from 'got';

const theGot = got.default;

jest.mock('os');

async function checkHead(url: string): Promise<number> {
// Due to funky redirects with GitHub, just making sure we get the 302 found and not follow
const response = await got.get(url, {followRedirect: false});
const response = await theGot.get(url, {followRedirect: false});
return response.statusCode;
}

Expand Down
11 changes: 4 additions & 7 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
module.exports = {
clearMocks: true,
moduleFileExtensions: ['js', 'ts'],
preset: 'ts-jest',
testEnvironment: 'node',
testMatch: ['**/*.test.ts'],
testRunner: 'jest-circus/runner',
transform: {
'^.+\\.ts$': 'ts-jest'
'^.+\\.ts?$': 'ts-jest',
},
verbose: true
}
transformIgnorePatterns: ['<rootDir>/node_modules/'],
};
Loading

0 comments on commit 13cd122

Please sign in to comment.