Skip to content

Commit 7b2893a

Browse files
authored
Update custom-transform.spec.ts
1 parent 07357b2 commit 7b2893a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/functional/custom-transform.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import "reflect-metadata";
2+
import {expect} from "chai";
23
import {classToPlain, plainToClass} from "../../src/index";
34
import {defaultMetadataStorage} from "../../src/storage";
45
import {Expose, Transform, Type} from "../../src/decorators";
@@ -198,15 +199,15 @@ describe("custom transformation decorator", () => {
198199
public address: Address;
199200

200201
@Type(() => Hobby)
201-
@Transform(value => value.filter(hobby => hobby.type === 'sport'), { toClassOnly: true })
202+
@Transform(value => value.filter(hobby: any => hobby.type === 'sport'), { toClassOnly: true })
202203
public hobbies: Hobby[];
203204

204205
public age: number;
205206
}
206207
model = plainToClass(Person, json);
207208
expect(model instanceof Person);
208209
expect(model.address instanceof Address);
209-
model.hobbies.forEach(hobby => expect(hobby instanceof Hobby && hobby.type === 'sport'));
210+
model.hobbies.forEach(hobby: any => expect(hobby instanceof Hobby && hobby.type === 'sport'));
210211
}).not.toThrowError();
211212
});
212213

0 commit comments

Comments
 (0)