Skip to content

Commit

Permalink
fix: don't require additional params type param
Browse files Browse the repository at this point in the history
Fixes a type regression introduced in #6
  • Loading branch information
jeffijoe committed May 27, 2019
1 parent 8f4a90d commit 4f504f3
Show file tree
Hide file tree
Showing 4 changed files with 858 additions and 500 deletions.
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,23 @@
"devDependencies": {
"@semantic-release/condition-codeship": "^1.1.0",
"@semantic-release/release-notes-generator": "^7.1.4",
"@types/jest": "^24.0.4",
"@types/node": "^11.9.3",
"@types/jest": "^24.0.13",
"@types/node": "^12.0.2",
"@types/rimraf": "^2.0.2",
"coveralls": "^3.0.2",
"husky": "^1.3.1",
"jest": "^24.1.0",
"lint-staged": "^8.1.4",
"prettier": "^1.16.4",
"coveralls": "^3.0.3",
"husky": "^2.3.0",
"jest": "^24.8.0",
"lint-staged": "^8.1.7",
"prettier": "^1.17.1",
"rimraf": "^2.6.3",
"semantic-release": "^15.13.3",
"semantic-release": "^15.13.12",
"semantic-release-conventional-commits": "^2.0.1",
"smid": "^0.1.1",
"ts-jest": "^23.10.5",
"tslint": "^5.12.1",
"ts-jest": "^24.0.2",
"tslint": "^5.16.0",
"tslint-config-prettier": "^1.18.0",
"tslint-config-standard": "^8.0.1",
"typescript": "^3.3.3"
"typescript": "^3.4.5"
},
"prettier": {
"semi": false,
Expand Down
4 changes: 2 additions & 2 deletions src/__tests__/make-error-class.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe('MakeErrorClass', () => {
})

describe('assert', () => {
class Test extends MakeErrorClass('This is a test', { statusCode: 400 }) {}
class Test extends MakeErrorClass('This is a test') {}

it('throws the correct error', () => {
const err = throws<Test>(() => Test.assert(false, 'Oh no'))
Expand Down Expand Up @@ -146,7 +146,7 @@ describe('MakeErrorClass', () => {
})
})

describe('ignore', async () => {
describe('ignore', () => {
class IgnorePlz extends MakeErrorClass('Ignore plz') {}

test('works', async () => {
Expand Down
4 changes: 2 additions & 2 deletions src/make-error-class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,14 @@ export interface BaseErrorConstructor<A> {
/**
* Makes an asserter function.
*/
makeAssert<T, A>(
makeAssert<T>(
message: string,
attrs?: Partial<ErrorAttributes<A>>
): Asserter<T>
/**
* Asserts the truthiness of the given value, throws the error otherwise.
*/
assert<T, A>(
assert<T>(
data: T,
message?: string,
attrs?: Partial<ErrorAttributes<A>>
Expand Down
Loading

0 comments on commit 4f504f3

Please sign in to comment.