ukor
ukor copied to clipboard
[Issue 64] Add support for running multiple unit tests frameworks
Related to issue #64
This pull request will remove the old test running implementation and adds possibility to create you own by an custom js script. That's add flexibility, so you can make any unit test running configuration you want.
Setup:
- You need to define your script: /scripts/runTests.js
const child_process = require('child_process')
const args = process.argv.slice(2)
const ip = args[0] // the roku device ip given as an argument by ukor
// main function call
main()
function main() {
child_process.execSync(`npx rooibosC -c ./.rooibosrc.json`)
child_process.execSync(`curl -d '' "http://${ip}:8060/launch/dev?RunTests=true"`)
}
- Add the path to your script to ukor.properties.yaml
...
buildDir: build
sourceDir: src
preBuild: scripts/preBuild.js
runUnitTestsScript: scripts/runTests.js
- Run command
ukor test [flavor] [device]
After running the test command, ukor will deploy the channel on given device.
Once the channel is deployed, ukor starts to run the runTests.js script with the device ip as argument.
You can get ip inside of runTests.js by:
const args = process.argv.slice(2)
const ip = args[0] // the roku device ip given as an argument by ukor