-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue #89 Call _brs_.resetMocks in between test files #90
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, I think we may need brs
changes as well to facilitate this. Also, let's add test cases in this repo once it's working 🙂
@@ -38,6 +38,8 @@ export class TestRunner { | |||
testFiles: string[] | |||
) { | |||
testFiles.forEach((filename, index) => { | |||
// Don't allow test files to pollute each other | |||
_brs_.resetMocks(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this will quite work -- _brs_
is only defined in Brightscript files, not Typescript, which is why we have compilation errors from Github Actions. I think we'll probably have to expose resetMocks
as an export in the brs
project, then call it from here.
@@ -1,8 +1,12252 @@ | |||
{ | |||
"name": "@hulu/roca", | |||
"version": "0.21.0", | |||
"lockfileVersion": 1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Careful, we don't want to upgrade our lockfile version as part of this PR. We could do it separately (or better yet, switch to Yarn), but we should keep it as-is for this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree with Levi, on a side note we had some dependencies issues with npm7
and this change might break things
Fix for issue #89 added
_brs_resetMocks()
function toTestRunner.ts
file.