forked from chinthakagodawita/autoupdate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from BondOrigination/lewis-update-fork-2
Update fork
- Loading branch information
Showing
15 changed files
with
2,010 additions
and
3,055 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
nodejs 18.15.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
module.exports = { | ||
"clearMocks": true, | ||
"collectCoverage": true, | ||
"coverageDirectory": "coverage", | ||
"coverageProvider": "v8", | ||
"preset": "ts-jest", | ||
"setupFiles": [ | ||
"<rootDir>/test/config.ts" | ||
], | ||
"testEnvironment": "node", | ||
"transform": { | ||
".(ts|tsx)": [ | ||
"ts-jest", | ||
{ | ||
tsconfig: "tsconfig.tests.json", | ||
compiler: "ttypescript", | ||
} | ||
] | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/** | ||
* For some reason, an `instanceof` check doesn't work with Octokit's `RequestError`. | ||
* This typeguard provides similar functionality, since realistically all | ||
* we care about is `status`. | ||
*/ | ||
export function isRequestError( | ||
error: Error, | ||
): error is Error & { status: number } { | ||
return 'status' in error; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { isRequestError } from '../../src/helpers/isRequestError'; | ||
|
||
describe('isRequestError', () => { | ||
class MockRequestError extends Error { | ||
constructor(public readonly status: number) { | ||
super(); | ||
} | ||
} | ||
|
||
it('should return true if a request error with a status is provided', () => { | ||
const error = new MockRequestError(403); | ||
expect(isRequestError(error)).toBe(true); | ||
}); | ||
|
||
it('should return false if a non-request error is provided', () => { | ||
const error = new Error('not a request error'); | ||
expect(isRequestError(error)).toBe(false); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"plugins": [ | ||
{ | ||
"transform": "ts-auto-mock/transformer", | ||
"cacheBetweenTests": false | ||
}, | ||
] | ||
}, | ||
"exclude": ["node_modules"] | ||
} |
Oops, something went wrong.