Skip to content

Commit ec8815c

Browse files
test(loaders): finished parameter test cases.
1 parent 4a6d4b4 commit ec8815c

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

test/loaders/parameter.loader.spec.ts

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* found in the LICENSE file at https://github.com/orchejs/rest/LICENSE
77
*/
88
import { expect } from 'chai';
9+
import { ParamType } from '../../lib/constants';
910
import { ParameterLoader } from '../../lib/loaders';
1011

1112
export class TestParameter {
@@ -15,11 +16,21 @@ export class TestParameter {
1516
describe('ParameterLoader', () => {
1617
describe('#addParameterConfig', () => {
1718
it(
18-
'Should add a new parameter configuration for a ',
19+
'Should add a new parameter configuration and be able to get it',
1920
() => {
20-
ParameterLoader.addParameterConfig()
21-
const interceptorConfigs = InterceptorLoader.interceptorConfigs;
22-
expect(interceptorConfigs).length.above(0);
21+
const testParam = new TestParameter();
22+
ParameterLoader.addParameterConfig(
23+
testParam,
24+
'testParameterMethod',
25+
null,
26+
1,
27+
ParamType.BodyParam
28+
);
29+
const paramConfig = ParameterLoader.getParameterConfig(
30+
'TestParameter',
31+
'testParameterMethod'
32+
);
33+
expect(paramConfig).to.be.not.undefined;
2334
});
2435
});
2536
});

0 commit comments

Comments
 (0)