Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
georgejecook
Streaming Star

Announcing Rooibos: Unit testing framework for roku.

Fellow roku developers,

I'm pleased to announce Rooibos unit testing framework. It's a fun, easy to use, and extremely powerful Brightscript unit testing framework, inspired by mocha for js.

It's open source, supported, and used in several production environments. The code is a major rewrite of the official unit testing framework for Roku: It is compatible with existing test suites.

In addition, the framework offers many more features, which make Test Drive Development, and all manner of testing far easier and more efficient.

You can incorporate it into your projects, running your existing test suites and writing more tests today!

Go visit the github: https://www.youtube.com/playlist?list=PLJRLV4QDx83vsYMD9bIs-cjoDXmNmO8Jv

Please raise issues and feel free to submit PR's. I'm actively supporting the library. You can get support on the Roku developers slack group: https://join.slack.com/t/rokudevelopers ... TVhNzJiY2M
George Cook
https://georgejecook.github.io/
https://linkedin.com/in/georgejecook/
Roku developers slack group (https://join.slack.com/t/rokudevelopers/shared_invite/zt-4vw7rg6v-NH46oY7hTktpRIBM_zGvwA) : georgejecook

Contact me on roku developer slack group, or via pm to discuss consultancy/work opportunities/rooibos unit testing framework
9 REPLIES 9
BVatBBOD
Visitor

Re: Announcing Rooibos: Unit testing framework for roku.

Been using this for my new project. Has worked great so far. Even given some feedback and submitted a PR and filed some issues on github.

If you want to start using this and are stuck or need help, hit me up on the Roku developers slack group. https://join.slack.com/t/rokudevelopers ... TVhNzJiY2M
Join the Roku Developers Slack Workspace for quicker help and great dev collaboration: http://tiny.cc/nrdf0y
0 Kudos
georgejecook
Streaming Star

Re: Announcing Rooibos: Unit testing framework for roku.

Some updates - I've added 2 new videos to the training series - there's an hour's worth of rooibos training for your viewing delight!

https://www.youtube.com/playlist?list=P ... oDXmNmO8Jv

The new videos will teach you how to write tests (103) and how to use the powerful stubs and mocks mechanism (104) to achieve highly efficient and effective unit and integration testing.

I've also added backward compatibility for the existing unit testing framework - you're running out of excuses to not be achieving testing zen 🙂

Go check it out: https://github.com/georgejecook/rooibos
George Cook
https://georgejecook.github.io/
https://linkedin.com/in/georgejecook/
Roku developers slack group (https://join.slack.com/t/rokudevelopers/shared_invite/zt-4vw7rg6v-NH46oY7hTktpRIBM_zGvwA) : georgejecook

Contact me on roku developer slack group, or via pm to discuss consultancy/work opportunities/rooibos unit testing framework
0 Kudos
georgejecook
Streaming Star

Re: Announcing Rooibos: Unit testing framework for roku.

If you follow the documentation and video tutorial, you will quickly understand how to write tests like this, which will allow you to quickly mock http services, and device apis:

'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'@It tests getVideosRealExample
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

'@Test basic test
'@Params["mp4", ["a", "b", "c"]]
'@Params["mp3", ["a", "b", "c", "d", "e"]]
function VMT__getVideosRealExample_basic(videoType, returnedJson) as void
  getjsonMock = m.expectOnce(m.httpService, "getJson", [m.ignoreValue, videoType], returnedJson, true)

  videos = m.module.getVideosRealExample(videoType)
  
  m.AssertArrayContainsSubset(videos, returnedJson)
end function

Which results in the following test output:

George Cook
https://georgejecook.github.io/
https://linkedin.com/in/georgejecook/
Roku developers slack group (https://join.slack.com/t/rokudevelopers/shared_invite/zt-4vw7rg6v-NH46oY7hTktpRIBM_zGvwA) : georgejecook

Contact me on roku developer slack group, or via pm to discuss consultancy/work opportunities/rooibos unit testing framework
0 Kudos
rymawby
Binge Watcher

Re: Announcing Rooibos: Unit testing framework for roku.

George this looks awesome! Thanks for developing it - I'm going to give it a go over the next couple of days. 
0 Kudos
rijo2423
Newbie

Re: Announcing Rooibos: Unit testing framework for roku.

Hi,

 

0 Kudos
jorgeku
Newbie

Re: Announcing Rooibos: Unit testing framework for roku.

Hi guys!.

I'm trying to configure this framework in my project, Does anyone have any tutorial to do this?.

I'm blocked, I don't know what I need put in my makefile or manifest file.

Thanks.

0 Kudos
vikashs099
Newbie

Re: Announcing Rooibos: Unit testing framework for roku.

I am also trying to integrate Rooibos and getting error

Error when loading plugin 'rooibos-roku': Error: Cannot find module 'brighterscript/dist/astUtils'

in bsconfig.json I added

{
    "plugins": [
           "rooibos-roku"
    ]
}

Am I Missing something. Anyone can suggest, would be grateful 

0 Kudos
ravali121
Newbie

Re: Announcing Rooibos: Unit testing framework for roku.

Make sure brighterscript exists in node_modules folder. If not do `npm install brighterscript`. That should fix it

FreemanC
Newbie

Re: Announcing Rooibos: Unit testing framework for roku.

You probably need to install Brighterscript 

0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.