Skip to content

Commit

Permalink
release: v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
oscar-guerin committed Dec 4, 2023
1 parent bb1c8b3 commit b9fb3c0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
5 changes: 3 additions & 2 deletions src/normalizer/denormalizer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ describe('Denormalizer', () => {
it('should call x times deserialize method when deserializeAll is called with array', () => {
const data: Mock[] = [new Mock(), new Mock()];
const toBeDenormalize: any = [{}, {}];
spyOn(denormalizer, 'deserialize').and.returnValues(...data);

jest.spyOn(denormalizer, 'deserialize').mockReturnValue(new Mock());

expect(denormalizer.deserializeAll(Mock, toBeDenormalize)).toEqual(data);
expect(denormalizer.deserialize).toHaveBeenCalledTimes(2);
Expand Down Expand Up @@ -389,5 +390,5 @@ describe('Denormalizer', () => {

expect(denormalizer.deserializeAll([Date, Map], vehicleData)).toEqual([]);
});
})
});
});
2 changes: 1 addition & 1 deletion src/normalizer/normalizer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ describe('Normalizer', () => {
it('should call x times serialize when serializeAll is called with array', () => {
const toBeNormalize: Mock[] = [new Mock(), new Mock()];
const data: any = [{}, {}];
spyOn(normalizer, 'serialize').and.returnValues(...data);
jest.spyOn(normalizer, 'serialize').mockReturnValue(new Mock());

expect(normalizer.serializeAll(toBeNormalize)).toEqual(data);
expect(normalizer.serialize).toHaveBeenCalledTimes(2);
Expand Down
8 changes: 4 additions & 4 deletions src/serializer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('Serializer', () => {
it('should call denormalizer when deserialize is call', () => {
const denormalized: Mock = new Mock();
const data: any = {};
spyOn(denormalizer, 'deserialize').and.returnValue(denormalized);
jest.spyOn(denormalizer, 'deserialize').mockReturnValue(denormalized);

expect(serializer.deserialize(Mock, data)).toBe(denormalized);
expect(denormalizer.deserialize).toHaveBeenCalledTimes(1);
Expand All @@ -42,7 +42,7 @@ describe('Serializer', () => {
it('should call normalizer when serialize is call', () => {
const toBeNormalize: Mock = new Mock();
const data: any = {};
spyOn(normalizer, 'serialize').and.returnValue(data);
jest.spyOn(normalizer, 'serialize').mockReturnValue(data);

expect(serializer.serialize(toBeNormalize)).toBe(data);
expect(normalizer.serialize).toHaveBeenCalledTimes(1);
Expand All @@ -52,7 +52,7 @@ describe('Serializer', () => {
it('should call normalizer when serializeAll is called', () => {
const toBeNormalize: Mock[] = [new Mock(), new Mock()];
const data: any = [{}, {}];
spyOn(normalizer, 'serializeAll').and.returnValues(data);
jest.spyOn(normalizer, 'serializeAll').mockReturnValue(data);

expect(serializer.serializeAll(toBeNormalize)).toEqual(data);
expect(normalizer.serializeAll).toHaveBeenCalledTimes(1);
Expand All @@ -62,7 +62,7 @@ describe('Serializer', () => {
it('should call denormalizer when deserializeAll is called', () => {
const data: Mock[] = [new Mock(), new Mock()];
const toBeDenormalize: any = [{}, {}];
spyOn(denormalizer, 'deserializeAll').and.returnValues(data);
jest.spyOn(denormalizer, 'deserializeAll').mockReturnValue(data);

expect(serializer.deserializeAll(Mock, toBeDenormalize)).toEqual(data);
expect(denormalizer.deserializeAll).toHaveBeenCalledTimes(1);
Expand Down

0 comments on commit b9fb3c0

Please sign in to comment.