-
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
feat(runner): Convert test runner from BrightScript to TS #62
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.
This will definitely give us more flexibility in the future, thanks for the hard work here. Other than my comments below I have a question regarding tap.brs
: can we convert that file to Typescript in the future? if so, is there any issue tacking that?
"spec", | ||
"tap", | ||
"xunit", | ||
] as const; |
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.
nice!
I don't think we can convert |
That sounds correct! The only alternative is to replace TAP as the brightscript-javascript bridge with some other format of our choosing. I could see a world where it becomes a JSON payload (with lines prefixed by some magic string for easier tagging), or if we wanted to get really creative we could add an extra function to the global That kind of migration seems out of scope for now though, and might not even be necessary if TAP isn't in the way of implementing features. |
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.
This all makes sense! Great work @lkipke — I'm looking forward to having more a more sophisticated test API 🧐🧣🍷🎻:high_society:
.
I've got a few small suggestions, but I'm approving on the assumption you'll do something reasonable in either direction with them 😉
/** | ||
* Generates an execution scope and runs the tests. | ||
* @param files List of filenames to load into the execution scope | ||
* @param options BRS interpreter options | ||
*/ |
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.
❤️ thanks for adding this!
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.
thanks for the changes
badc1dd
to
f219aab
Compare
Change Summary
This converts the functionality from
roca_main.brs
to Typescript, using the newcreateExecuteFromScope
functionality implemented in sjbarag/brs#603.Running tests in TS rather than Brightscript gets us much more flexibility with error handling/reporting, plus it allows for much easier future enhancements to CLI args (think: passing in a single file name to test,
grep
-ing file patterns, etc). And it will integrate nicely with a Jest-style reporter that we will eventually (hopefully) have.