( paramSpec: ParameterObject, rawValue: string | undefined | object, expectedResult: T, opts?: TestOptions, )
| 107 | } |
| 108 | |
| 109 | export function test<T>( |
| 110 | paramSpec: ParameterObject, |
| 111 | rawValue: string | undefined | object, |
| 112 | expectedResult: T, |
| 113 | opts?: TestOptions, |
| 114 | ) { |
| 115 | const caller: string = new Error().stack!; |
| 116 | const testName = buildTestName(rawValue, expectedResult, opts); |
| 117 | |
| 118 | it(testName, async () => { |
| 119 | await testCoercion({ |
| 120 | paramSpec, |
| 121 | rawValue, |
| 122 | expectedResult, |
| 123 | caller, |
| 124 | expectError: expectedResult instanceof HttpErrors.HttpError, |
| 125 | opts: opts ?? {}, |
| 126 | }); |
| 127 | }); |
| 128 | } |
| 129 | |
| 130 | function buildTestName<T>( |
| 131 | rawValue: string | undefined | object, |
no test coverage detected