不要怂,就是干,撸起袖子干!

Commit 1b295c0b by Sushant

test: ignoreOnDuplicate message assertion

1 parent 8b937dd7
Showing with 2 additions and 7 deletions
...@@ -421,7 +421,6 @@ describe(Support.getTestDialectTeaser('Model'), () => { ...@@ -421,7 +421,6 @@ describe(Support.getTestDialectTeaser('Model'), () => {
}); });
} else { } else {
it('should throw an error when the ignoreDuplicates option is passed', function() { it('should throw an error when the ignoreDuplicates option is passed', function() {
const self = this;
const data = [ const data = [
{ uniqueName: 'Peter', secretValue: '42' }, { uniqueName: 'Peter', secretValue: '42' },
{ uniqueName: 'Paul', secretValue: '23' } { uniqueName: 'Paul', secretValue: '23' }
...@@ -430,12 +429,8 @@ describe(Support.getTestDialectTeaser('Model'), () => { ...@@ -430,12 +429,8 @@ describe(Support.getTestDialectTeaser('Model'), () => {
return this.User.bulkCreate(data, { fields: ['uniqueName', 'secretValue'] }).then(() => { return this.User.bulkCreate(data, { fields: ['uniqueName', 'secretValue'] }).then(() => {
data.push({ uniqueName: 'Michael', secretValue: '26' }); data.push({ uniqueName: 'Michael', secretValue: '26' });
return self.User.bulkCreate(data, { fields: ['uniqueName', 'secretValue'], ignoreDuplicates: true }).catch(err => { return this.User.bulkCreate(data, { fields: ['uniqueName', 'secretValue'], ignoreDuplicates: true }).catch(err => {
if (dialect === 'mssql') { expect(err.message).to.equal(`${dialect} does not support the ignoreDuplicates option.`);
expect(err.message).to.match(/mssql does not support the \'ignoreDuplicates\' option./);
} else {
expect(err.message).to.match(/postgres does not support the \'ignoreDuplicates\' option./);
}
}); });
}); });
}); });
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!