Skip to content

Commit

Permalink
feat: test case
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateus Garcia committed Apr 16, 2023
1 parent 5bc9c89 commit bea7122
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,18 @@ describe('InjectServiceDecorator', () => {
Object.keys(Bindings).filter((k) => !example.includes(k))
);
});

it('should save options in class and correctly set overrideName', () => {
const testedEntity = class SomeEntity {};
const apiOptions: DecoratorOptions = {
allowMethod: ['getAll', 'deleteRelationship'],
overrideName: '123'
};

@JsonApi(testedEntity, apiOptions)
class SomeClass {}

const data = Reflect.getMetadata(JSON_API_DECORATOR_OPTIONS, SomeClass);
expect(data).toEqual(apiOptions);
});
});

0 comments on commit bea7122

Please sign in to comment.