Skip to content

Commit 07b847e

Browse files
committed
Fix types
1 parent a816ee8 commit 07b847e

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

types/main.test-d.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
import { expectType, expectError } from 'tsd'
22

3-
import modernErrors from 'modern-errors'
3+
import ModernError from 'modern-errors'
44
import modernErrorsClean from 'modern-errors-clean'
55

6-
const BaseError = modernErrors([modernErrorsClean])
7-
const error = new BaseError('', { cause: '' })
6+
const BaseError = ModernError.subclass('BaseError', {
7+
plugins: [modernErrorsClean],
8+
})
9+
const error = new BaseError('')
810

9-
expectError(modernErrors([modernErrorsClean], { stack: undefined }))
11+
expectError(
12+
ModernError.subclass('TestError', {
13+
plugins: [modernErrorsClean],
14+
stack: undefined,
15+
}),
16+
)
1017

1118
expectType<string | undefined>(error.stack)

0 commit comments

Comments
 (0)