(path, options, expectation)
| 15 | describe(Support.getTestDialectTeaser(class="st">'SQL'), () => { |
| 16 | describe(class="st">'generateJoin', () => { |
| 17 | const testsql = function(path, options, expectation) { |
| 18 | |
| 19 | const name = `${path}, ${util.inspect(options, { depth: 10 })}`; |
| 20 | |
| 21 | Sequelize.Model._conformIncludes(options); |
| 22 | options = Sequelize.Model._validateIncludedElements(options); |
| 23 | |
| 24 | const include = _.at(options, path)[0]; |
| 25 | |
| 26 | it(name, () => { |
| 27 | |
| 28 | const join = sql.generateJoin(include, |
| 29 | { |
| 30 | options, |
| 31 | subQuery: options.subQuery === undefined ? options.limit && options.hasMultiAssociation : options.subQuery |
| 32 | } |
| 33 | ); |
| 34 | |
| 35 | return expectsql(`${join.join} ${join.body} ON ${join.condition}`, expectation); |
| 36 | }); |
| 37 | }; |
| 38 | |
| 39 | const User = current.define(class="st">'User', { |
| 40 | id: { |
no test coverage detected