Skip to content

Commit

Permalink
args test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wentout committed Nov 9, 2023
1 parent b856916 commit 0d6aedd
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions test/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const tests = (opts) => {
SubOfSomeADTCTypePre,
SubOfSomeADTCTypePost,
subOfSomeADTCInstanceA,
subOfSomeADTCInstanceANoArgs,
subOfSomeADTCInstanceC,
subOfSomeADTCInstanceB,
anotherNamespace,
Expand Down Expand Up @@ -351,7 +352,9 @@ const tests = (opts) => {

expect(SubOfSomeADTCTypePre.existentInstance).equal(someADTCInstance);
expect(SubOfSomeADTCTypePost.existentInstance).equal(someADTCInstance);
expect(subOfSomeADTCInstanceANoArgs.test).equal(123);
expect(subOfSomeADTCInstanceA.test).equal(123);
expect(subOfSomeADTCInstanceANoArgs.sub_test).equal(321);
expect(subOfSomeADTCInstanceA.sub_test).equal(321);
expect(subOfSomeADTCInstanceA.args).deep.to.equal([ 1, 2, 3 ]);

Expand Down
2 changes: 2 additions & 0 deletions test/hookSamples.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ const namespaceFlowCheckerSample = [
'SubOfSomeADTCType',
'SubOfSomeADTCType',
'SubOfSomeADTCType',
'SubOfSomeADTCType',
'SubOfSomeADTCType',
'UserType',
'UserType',
'UserTypePL1',
Expand Down
6 changes: 3 additions & 3 deletions test/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const tests = (opts) => {
assert.equal(8, userTypeHooksInvocations.length);
debugger;
// +2
assert.equal(177, namespaceFlowCheckerInvocations.length);
assert.equal(179, namespaceFlowCheckerInvocations.length);
// +2
assert.equal(169, typesFlowCheckerInvocations.length);
// +1
Expand All @@ -48,10 +48,10 @@ const tests = (opts) => {
// +1
assert.equal(77, typesPostCreationInvocations.length);
// +1
assert.equal(96, namespacePreCreationInvocations.length);
assert.equal(97, namespacePreCreationInvocations.length);
// there are two registered Hooks, that is why
// +2
assert.equal(162, namespacePostCreationInvocations.length);
assert.equal(164, namespacePostCreationInvocations.length);
});
});

Expand Down
2 changes: 2 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ SubOfSomeADTCType.registerHook('postCreation', (opts) => {
});

// debugger;
const subOfSomeADTCInstanceANoArgs = apply(someADTCInstance, SubOfSomeADTCType);
const subOfSomeADTCInstanceA = apply(someADTCInstance, SubOfSomeADTCType, [ 1, 2, 3 ]);

// debugger;
Expand Down Expand Up @@ -608,6 +609,7 @@ describe('Main Test', () => {
someADTCInstance,
SubOfSomeADTCTypePre,
SubOfSomeADTCTypePost,
subOfSomeADTCInstanceANoArgs,
subOfSomeADTCInstanceA,
subOfSomeADTCInstanceC,
subOfSomeADTCInstanceB,
Expand Down

0 comments on commit 0d6aedd

Please sign in to comment.