Skip to content

How to mock callr server for automating testing purposes #11

@Cactusbone

Description

@Cactusbone

Hello !

I'm trying to automatically test code which uses your sdk, and would like to mock your server (to ensure the test work in isolation),

I've found this code

// allow api url to be changed
	this.apiUrl = "https://api.callr.com/json-rpc/v1.1/";

which can be customized to point to another url, however port is hardcoded to 443 options.port = 443; making it difficult to start a mock on a linux host.

Can this be modified to default the port if none is found ?

Do you have and can provide a basic mock of your server to ease these kind of testing ?
(Additionally, it would be nice if the sdk had automatic tests too, I believe a HTTP_CODE_ERROR error is always followed by another callback call (from the parseData call on end event), which is not recommanded at all)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions