(query, assertions)
| 214 | }, |
| 215 | |
| 216 | expectsql(query, assertions) { |
| 217 | const expectations = assertions.query || assertions; |
| 218 | let expectation = expectations[Support.sequelize.dialect.name]; |
| 219 | |
| 220 | if (!expectation) { |
| 221 | if (expectations[class="st">'default'] !== undefined) { |
| 222 | expectation = expectations[class="st">'default']; |
| 223 | if (typeof expectation === class="st">'string') { |
| 224 | expectation = expectation |
| 225 | .replace(/\[/g, Support.sequelize.dialect.TICK_CHAR_LEFT) |
| 226 | .replace(/\]/g, Support.sequelize.dialect.TICK_CHAR_RIGHT); |
| 227 | } |
| 228 | } else { |
| 229 | throw new Error(`Undefined expectation for class="st">"${Support.sequelize.dialect.name}"!`); |
| 230 | } |
| 231 | } |
| 232 | |
| 233 | if (query instanceof Error) { |
| 234 | expect(query.message).to.equal(expectation.message); |
| 235 | } else { |
| 236 | expect(query.query || query).to.equal(expectation); |
| 237 | } |
| 238 | |
| 239 | if (assertions.bind) { |
| 240 | const bind = assertions.bind[Support.sequelize.dialect.name] || assertions.bind[class="st">'default'] || assertions.bind; |
| 241 | expect(query.bind).to.deep.equal(bind); |
| 242 | } |
| 243 | }, |
| 244 | |
| 245 | rand() { |
| 246 | return Math.floor(Math.random() * 10e5); |
no outgoing calls