Skip to content

Commit

Permalink
Fix $before/after call counter property test values
Browse files Browse the repository at this point in the history
  • Loading branch information
lehni committed Feb 12, 2024
1 parent 6e51b5b commit 78e6d9d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion testUtils/TestSession.js
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ TestSession.unhandledRejectionHandlers = [];
TestSession.hookCounter = 0;

// Creates a hook that waits for `delay` milliseconds and then
// increments a `${name}Called` property. The hook is asynchonous
// increments a `${name}Called` property. The hook is asynchronous
// every other time it is called so that the synchronous path is
// also tested.
function createHook(name, delay, extraAction) {
Expand Down
12 changes: 6 additions & 6 deletions tests/integration/insert.js
Original file line number Diff line number Diff line change
Expand Up @@ -439,8 +439,8 @@ module.exports = (session) => {
model1Prop1: 'hello 3',
model1Prop2: null,
model1Id: null,
$beforeInsertCalled: true,
$afterInsertCalled: true,
$beforeInsertCalled: 1,
$afterInsertCalled: 1,
});
return session.knex(Model1.getTableName());
})
Expand All @@ -466,8 +466,8 @@ module.exports = (session) => {
model1Prop1: 'hello 3',
model1Prop2: null,
model1Id: null,
$beforeInsertCalled: true,
$afterInsertCalled: true,
$beforeInsertCalled: 1,
$afterInsertCalled: 1,
});

expect(inserted[1]).to.be.a(Model1);
Expand All @@ -477,8 +477,8 @@ module.exports = (session) => {
model1Prop1: 'hello 4',
model1Prop2: 10,
model1Id: null,
$beforeInsertCalled: true,
$afterInsertCalled: true,
$beforeInsertCalled: 1,
$afterInsertCalled: 1,
});

return session.knex(Model1.getTableName());
Expand Down
8 changes: 4 additions & 4 deletions tests/integration/patch.js
Original file line number Diff line number Diff line change
Expand Up @@ -408,9 +408,9 @@ module.exports = (session) => {
model1Prop1: 'updated text',
model1Prop2: null,
model1Id: null,
$beforeUpdateCalled: true,
$beforeUpdateCalled: 1,
$beforeUpdateOptions: { patch: true },
$afterUpdateCalled: true,
$afterUpdateCalled: 1,
$afterUpdateOptions: { patch: true },
});
return session.knex('Model1').orderBy('id');
Expand All @@ -436,9 +436,9 @@ module.exports = (session) => {
model1Prop1: 'updated text',
model1Prop2: null,
model1Id: null,
$beforeUpdateCalled: true,
$beforeUpdateCalled: 1,
$beforeUpdateOptions: { patch: true },
$afterUpdateCalled: true,
$afterUpdateCalled: 1,
$afterUpdateOptions: { patch: true },

model1Relation2: [
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,9 @@ module.exports = (session) => {
model1Prop1: 'updated text',
model1Prop2: null,
model1Id: null,
$beforeUpdateCalled: true,
$beforeUpdateCalled: 1,
$beforeUpdateOptions: {},
$afterUpdateCalled: true,
$afterUpdateCalled: 1,
$afterUpdateOptions: {},
});
return session.knex('Model1').orderBy('id');
Expand Down

0 comments on commit 78e6d9d

Please sign in to comment.