We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a816ee8 commit 07b847eCopy full SHA for 07b847e
1 file changed
types/main.test-d.ts
@@ -1,11 +1,18 @@
1
import { expectType, expectError } from 'tsd'
2
3
-import modernErrors from 'modern-errors'
+import ModernError from 'modern-errors'
4
import modernErrorsClean from 'modern-errors-clean'
5
6
-const BaseError = modernErrors([modernErrorsClean])
7
-const error = new BaseError('', { cause: '' })
+const BaseError = ModernError.subclass('BaseError', {
+ plugins: [modernErrorsClean],
8
+})
9
+const error = new BaseError('')
10
-expectError(modernErrors([modernErrorsClean], { stack: undefined }))
11
+expectError(
12
+ ModernError.subclass('TestError', {
13
14
+ stack: undefined,
15
+ }),
16
+)
17
18
expectType<string | undefined>(error.stack)
0 commit comments