Skip to content

Commit 59588d8

Browse files
committed
feat: export RuntimeTypeError and test that it's thrown
1 parent 09b9bb8 commit 59588d8

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/index.spec.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { describe, it } from 'mocha'
22
import * as t from './'
3+
import { expect } from 'chai'
34

45
type ServiceScalingParameters = {
56
DesiredCount?: number | null | undefined
@@ -385,5 +386,10 @@ describe(`smoke test`, function() {
385386
}
386387

387388
DeployConfigType.assert(config)
389+
const { Redis, ...rest } = config
390+
391+
expect(() => DeployConfigType.assert(rest as any)).to.throw(
392+
t.RuntimeTypeError
393+
)
388394
})
389395
})

src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import TupleType from './types/TupleType'
2020
import UnionType from './types/UnionType'
2121
import VoidType from './types/VoidType'
2222
import Validation from './Validation'
23+
import RuntimeTypeError from './errorReporting/RuntimeTypeError'
2324

2425
export {
2526
Type,
@@ -44,6 +45,7 @@ export {
4445
UnionType,
4546
VoidType,
4647
Validation,
48+
RuntimeTypeError,
4749
}
4850

4951
export const any = (): Type<any> => new AnyType()

0 commit comments

Comments
 (0)