We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2e81c58 commit 2e40628Copy full SHA for 2e40628
tests/integration_tests/model/Model.test.ts
@@ -62,6 +62,28 @@ describe('Model', () =>
62
expect(user.firstName).toEqual('test1');
63
});
64
65
+ test('save', async () =>
66
+ {
67
+ const firstName = 'test test';
68
+ let user = await User.findById(1);
69
+ user.firstName = firstName;
70
+ await user.save();
71
+
72
+ user = await User.findById(1);
73
+ expect(user.firstName).toEqual(firstName);
74
+ });
75
76
+ test('saveMany', async () =>
77
78
+ await User.saveMany([
79
+ {id: 3, firstName: 'test3'},
80
+ {id: 4, firstName: 'test4'}
81
+ ]);
82
83
+ const users = await User.all();
84
+ expect(users.length).toEqual(4);
85
86
87
test('select', async () =>
88
{
89
const users = await User.select(['id']).orderBy('id', 'asc').get();
0 commit comments