MCPcopy
hub / github.com/sequelize/sequelize / test

Function test

test/integration/model/create.test.js:404–420  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

402 if (current.dialect.supports.transactions) {
403 it('should release transaction when meeting errors', async function() {
404 const test = async times => {
405 if (times > 10) {
406 return true;
407 }
408
409 try {
410 return await pTimeout(this.Student.findOrCreate({
411 where: {
412 no: 1
413 }
414 }), 1000);
415 } catch (e) {
416 if (e instanceof Sequelize.ValidationError) return test(times + 1);
417 if (e instanceof pTimeout.TimeoutError) throw new Error(e);
418 throw e;
419 }
420 };
421
422 await test(0);
423 });

Callers 2

create.test.jsFile · 0.70
executeTestFunction · 0.50

Calls 1

findOrCreateMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…