forked from dynamodb-toolbox/dynamodb-toolbox
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
apply inverseTransform + typeHidden after repo sync
- Loading branch information
1 parent
a86b7a8
commit 611b08e
Showing
9 changed files
with
99 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,11 +22,12 @@ const TestTable = new Table({ | |
describe('parse',()=>{ | ||
|
||
it('parses single item', ()=>{ | ||
let item = TestEntity.parse({ pk: '[email protected]', sk: 'email', test_string: 'test', _et: 'TestEntity' }) | ||
let item = TestEntity.parse({ pk: '[email protected]', sk: 'email', test_string: 'test', inverse_transformed_simple_string: "transformed", _et: 'TestEntity' }) | ||
expect(item).toEqual({ | ||
email: '[email protected]', | ||
test_type: 'email', | ||
test_string: 'test', | ||
inverse_transformed_simple_string: "TRANSFORMED", | ||
entity: 'TestEntity' | ||
}) | ||
}) | ||
|
@@ -41,19 +42,21 @@ describe('parse',()=>{ | |
|
||
it('parses multiple items', ()=>{ | ||
let items = TestEntity.parse([ | ||
{ pk: '[email protected]', sk: 'email', test_string: 'test' }, | ||
{ pk: '[email protected]', sk: 'email2', test_string: 'test2' } | ||
{ pk: '[email protected]', sk: 'email', test_string: 'test', inverse_transformed_simple_string: "transformed", }, | ||
{ pk: '[email protected]', sk: 'email2', test_string: 'test2', inverse_transformed_simple_string: "transformed", } | ||
]) | ||
expect(items).toEqual([ | ||
{ | ||
email: '[email protected]', | ||
test_type: 'email', | ||
test_string: 'test' | ||
test_string: 'test', | ||
inverse_transformed_simple_string: "TRANSFORMED", | ||
}, | ||
{ | ||
email: '[email protected]', | ||
test_type: 'email2', | ||
test_string: 'test2' | ||
test_string: 'test2', | ||
inverse_transformed_simple_string: "TRANSFORMED", | ||
} | ||
]) | ||
}) | ||
|
@@ -76,11 +79,11 @@ describe('parse',()=>{ | |
}) | ||
|
||
it('parses composite field', ()=>{ | ||
let item = SimpleEntity.parse({ pk: '[email protected]', sk: 'active#email', test_composite: 'test' }) | ||
let item = SimpleEntity.parse({ pk: '[email protected]', sk: 'active#email', test_composite: 'test' }) | ||
expect(item).toEqual({ | ||
pk: '[email protected]', | ||
test_composite: 'test', | ||
test_composite2: 'email' | ||
test_composite2: 'email', | ||
}) | ||
}) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters