Skip to content

fix hasBeenCalled function#147

Merged
nadiapadalka merged 1 commit into
mainfrom
hasBeenCalledFix
Mar 19, 2026
Merged

fix hasBeenCalled function#147
nadiapadalka merged 1 commit into
mainfrom
hasBeenCalledFix

Conversation

@nadiapadalka

Copy link
Copy Markdown
Collaborator

Added functionality to compare values inside deepEquals function, and tests for testing
Screenshot 2026-03-10 at 21 03 12

@Nowele Nowele self-assigned this Mar 11, 2026

@Nowele Nowele left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yarn run-s clean build test

 PASS  test/e2e/parameterized/parameterized.test.js
 PASS  test/e2e/simple-suites/simple-suites.test.js
 PASS  test/e2e/assert/assert.test.js
 PASS  test/e2e/before-after/before-after.test.js
 PASS  test/e2e/selection/selection.test.js
 PASS  test/runner/file-match.test.ts (7.907 s)
 PASS  test/reporter/jest-reporter.test.ts (8.38 s)

Test Suites: 7 passed, 7 total
Tests:       33 passed, 33 total
Snapshots:   0 total
Time:        8.965 s

@olenahuchko olenahuchko assigned Nowele and olenahuchko and unassigned Nowele Mar 16, 2026

@olenahuchko olenahuchko left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your fix looks great to me, also verified with some other test cases:

mockFunc = _brs_.mockFunction("testHasBeenCalledWith", sub (value as boolean) : end sub)
m.node.callFunc("testHasBeenCalledWith", true)
m.assert.hasBeenCalledWith(mockFunc, [false], "") ' - failed 🟢 

m.assert.deepEquals([true], [false], "")  ' - failed 🟢 

m.assert.deepEquals({value: true}, {value: false}, "") ' - passed 🔴 

m.assert.deepEquals(true, false, "") ' - passed 🔴 

The last two are not related to hasBeenCalled, but it would be great to get it fixed as well here or maybe in the separate ticket

@nadiapadalka

Copy link
Copy Markdown
Collaborator Author

Your fix looks great to me, also verified with some other test cases:

mockFunc = _brs_.mockFunction("testHasBeenCalledWith", sub (value as boolean) : end sub)
m.node.callFunc("testHasBeenCalledWith", true)
m.assert.hasBeenCalledWith(mockFunc, [false], "") ' - failed 🟢 

m.assert.deepEquals([true], [false], "")  ' - failed 🟢 

m.assert.deepEquals({value: true}, {value: false}, "") ' - passed 🔴 

m.assert.deepEquals(true, false, "") ' - passed 🔴 

The last two are not related to hasBeenCalled, but it would be great to get it fixed as well here or maybe in the separate ticket

Yes, let's create a separate ticket for deepEquals

@nadiapadalka nadiapadalka merged commit 41d6161 into main Mar 19, 2026
3 checks passed
@nadiapadalka

Copy link
Copy Markdown
Collaborator Author

merging this in as this PR has 2 approvals

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants