Skip to content

Commit

Permalink
test(auto-increment): use "ordered" for creation
Browse files Browse the repository at this point in the history
fix #13
  • Loading branch information
hasezoey committed Dec 11, 2023
1 parent c61dc5a commit e879241
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/plugin-typegoose-auto-increment/test/basic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ describe('Plugin @typegoose/auto-increment', () => {
type Helper<V> = V & { [key: string]: any };

it('should create users with incrementing signup-id and store modified amount', async () => {
const docs = await UserModel.create([{ name: 'Luke' }, { name: 'Joe' }, { name: 'Linus' }]);
// using "ordered" to ensure the insertion order is the definition order
const docs = await UserModel.create([{ name: 'Luke' }, { name: 'Joe' }, { name: 'Linus' }], { ordered: true });

expect(docs[0]).toMatchObject<Helper<User>>({
name: 'Luke',
Expand Down

0 comments on commit e879241

Please sign in to comment.