Custom Clients
Writing custom clients for testickle
are really easy, they just have to do 1-2 things depending on the type of test
Unit Test
For a unit test client, testickle
requires nothing as long as the client can self assert failure.
So if a test fails just written an non zero exit code. (process.exit(1)
)
Browser Test
For a browser test client, we do require a few things to work properly.
testickle
detects the test result for browser tests by listening for results on localhost:8080/log
.
The test cannot exit unless you send a POST
to the same url.
The request handler also expects the data to be in the shape of
type BrowserTestGroupReturn = {
passed: number;
failed: number;
total: number;
errors: string[];
testName: string;
};
E2E Test
For a E2E test, testickle
will eval
your javascript code.
So there are a few things required
- You have to go to whatever website you are testing by setting
window.location
- You have to return your results, the expected shape is the same as
BrowserTestGroupReturn
above