diff --git a/src/sscce-sequelize-6.ts b/src/sscce-sequelize-6.ts index c90761b96..6ac6be4dc 100644 --- a/src/sscce-sequelize-6.ts +++ b/src/sscce-sequelize-6.ts @@ -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' + ); } diff --git a/src/sscce-sequelize-7.ts b/src/sscce-sequelize-7.ts deleted file mode 100644 index 861b9fdea..000000000 --- a/src/sscce-sequelize-7.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { DataTypes, Model } from '@sequelize/core'; -import { createSequelize7Instance } from '../setup/create-sequelize-instance'; -import { expect } from 'chai'; -import sinon from 'sinon'; - -// if your issue is dialect specific, remove the dialects you don't need to test on. -export const testingOnDialects = new Set(['mssql', 'sqlite', 'mysql', 'mariadb', 'postgres', 'postgres-native']); - -// You can delete this file if you don't want your SSCCE to be tested against Sequelize 7 - -// Your SSCCE goes inside this function. -export async function run() { - // This function should be used instead of `new Sequelize()`. - // It applies the config for your SSCCE to work on CI. - const sequelize = createSequelize7Instance({ - logQueryParameters: true, - benchmark: true, - define: { - // For less clutter in the SSCCE - timestamps: false, - }, - }); - - class Foo extends Model {} - - Foo.init({ - name: DataTypes.TEXT, - }, { - sequelize, - modelName: 'Foo', - }); - - // You can use sinon and chai assertions directly in your SSCCE. - const spy = sinon.spy(); - sequelize.afterBulkSync(() => spy()); - await sequelize.sync({ force: true }); - expect(spy).to.have.been.called; - - console.log(await Foo.create({ name: 'TS foo' })); - expect(await Foo.count()).to.equal(1); -}