Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reproduce issue where instance update where option is not used #256

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/sscce-sequelize-6.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,15 @@ export async function run() {
sequelize.afterBulkSync(() => spy());
await sequelize.sync({ force: true });
expect(spy).to.have.been.called;

const foo = await Foo.create({ name: 'original name', id : 1 });
await Foo.update({ name: 'random update'}, {where: { id : 1 }});
const updated = await foo.update({ name: 'updated name'}, { where: { name: 'original name' } });

console.log(await Foo.create({ name: 'TS foo' }));
expect(await Foo.count()).to.equal(1);
// no update should happen
expect(updated.get('name'))
.equal(
'random update',
'no update should happen because of where option'
);
}
41 changes: 0 additions & 41 deletions src/sscce-sequelize-7.ts

This file was deleted.

Loading