MCPcopy
hub / github.com/sequelize/sequelize / testsql

Function testsql

test/unit/sql/generateJoin.test.js:17–37  ·  test/unit/sql/generateJoin.test.js::testsql
(path, options, expectation)

Source from the content-addressed store, hash-verified

15describe(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: {

Callers 1

Calls 5

expectsqlFunction · 0.85
inspectMethod · 0.80
_conformIncludesMethod · 0.80
generateJoinMethod · 0.80

Tested by

no test coverage detected