Skip to content

Commit

Permalink
fix(test): add aliasesMapping to manual tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Rinot authored and mrrinot committed Feb 19, 2020
1 parent 2c2ce36 commit 0bea6fe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/integration/sequelize.test.js
Expand Up @@ -1315,11 +1315,12 @@ describe(Support.getTestDialectTeaser('Sequelize'), () => {
} else {
it('correctly handles multiple transactions', function() {
const TransactionTest = this.sequelizeWithTransaction.define('TransactionTest', { name: DataTypes.STRING }, { timestamps: false });
const aliasesMapping = new Map([['_0', 'cnt']]);

const count = transaction => {
const sql = this.sequelizeWithTransaction.getQueryInterface().QueryGenerator.selectQuery('TransactionTests', { attributes: [['count(*)', 'cnt']] });

return this.sequelizeWithTransaction.query(sql, { plain: true, transaction }).then(result => {
return this.sequelizeWithTransaction.query(sql, { plain: true, transaction, aliasesMapping }).then(result => {
return parseInt(result.cnt, 10);
});
};
Expand Down

0 comments on commit 0bea6fe

Please sign in to comment.