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

Commit 7022505d by Cao Jiannan Committed by Sushant

add test for "should return autoIncrement primary key" (#6476)

* add test for "should return autoIncrement primary key"

add test for "should return autoIncrement primary key"

* add secret

* simple the test

* put into one line

* add returning: true option

* change test location

* add missing });

* remove ok

* recover to be ok

* recover test for all

* add test for create
1 parent f13eb40e
Showing with 24 additions and 0 deletions
......@@ -1852,6 +1852,30 @@ describe(Support.getTestDialectTeaser('Model'), function() {
expect(m.secret).to.be.eql(M2.secret);
});
});
it('should return autoIncrement primary key (create)', function() {
var Maya = this.sequelize.define('Maya', {});
var M1 = {};
return Maya.sync({ force: true }).then(() => Maya.create(M1, {returning: true}))
.then((m) => {
expect(m.id).to.be.eql(1);
});
});
it('should return autoIncrement primary key (bulkCreate)', function() {
var Maya = this.sequelize.define('Maya', {});
var M1 = {};
var M2 = {};
return Maya.sync({ force: true }).then(() => Maya.bulkCreate([M1, M2], {returning: true}))
.then((ms) => {
expect(ms[0].id).to.be.eql(1);
expect(ms[1].id).to.be.eql(2);
});
});
});
it('should support logging', function () {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!