We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent af605ae commit 6205ae1Copy full SHA for 6205ae1
test/functional/custom-transform.spec.ts
@@ -6,6 +6,24 @@ import * as moment from "moment";
6
7
describe("custom transformation decorator", () => {
8
9
+ it("@Expose decorator with 'name' option should work with @Transform decorator", () => {
10
+ defaultMetadataStorage.clear();
11
+
12
+ class User {
13
14
+ @Expose({name: 'user_name'})
15
+ @Transform(value => value.toUpperCase())
16
+ name: string;
17
+ }
18
19
+ let plainUser = {
20
+ name: "Johny Cage"
21
+ };
22
23
+ const classedUser = plainToClass(User, plainUser);
24
+ classedUser.name.should.be.equal("JOHNY CAGE");
25
+ });
26
27
it("@Transform decorator logic should be executed depend of toPlainOnly and toClassOnly set", () => {
28
defaultMetadataStorage.clear();
29
0 commit comments