Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,27 @@ kopytko <command> --help
| start | s | Compiles and runs an application on a Roku device |
| test | t | Compiles and runs unit tests on a Roku device |
| new | n | Creates new kopytko application |

## Test command options

| Option | Env var | Description |
|--------|---------|-------------|
| `--testFileName=<name>` | `TEST_FILE_NAME` | Run only tests whose file name matches `<name>` |
| `--tests=<patterns>` | `TESTS` | Semicolon-separated glob patterns of unit names to build and run (e.g. `Home*;Video*;Button`). Filters at build time — only matching test files are compiled and deployed |
| `--forceConnect` | — | Kill any process occupying port 8085 before connecting to read test results |
| `--rokuIP=<ip>` | `ROKU_IP` | IP address of the target Roku device |
| `--rokuDevPassword=<password>` | `ROKU_DEV_PASSWORD` | Developer password for the target Roku device |

```shell
# Run all tests
npm test

# Run tests for a single unit (shorthand)
npm test -- MyService

# Run tests matching glob patterns in a single build+deploy
npm test -- --tests="Home*;Video*;Button"

# Force-take port 8085 if occupied
npm test -- --forceConnect
```
2 changes: 2 additions & 0 deletions commands/test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const rokuDevPasswordOption = require('../options/rokuDevPassword');
const testFileNameOption = require('../options/testFileName');
const testsOption = require('../options/tests');
const forceConnectOption = require('../options/forceConnect');
const forceHttpOption = require('../options/forceHttp');
const rokuIPOption = require('../options/rokuIP');
Expand All @@ -13,6 +14,7 @@ function load(program) {
.addOption(rokuIPOption)
.addOption(rokuDevPasswordOption)
.addOption(testFileNameOption)
.addOption(testsOption)
.addOption(telnetOption)
.addOption(forceHttpOption)
.addOption(forceConnectOption)
Expand Down
4 changes: 4 additions & 0 deletions options/tests.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
const { Option } = require('commander');

module.exports = new Option('--tests <string>', 'Semicolon-separated glob patterns of unit test names to run (e.g. Rail*;Video*;Tile*)')
.env('TESTS');
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
},
"peerDependencies": {
"@dazn/kopytko-packager": "^1.4.2",
"@dazn/kopytko-unit-testing-framework": "^2.5.2"
"@dazn/kopytko-unit-testing-framework": "^2.6.0"
},
"license": "MIT",
"repository": {
Expand Down