{"id":28100346,"url":"https://github.com/tidev/titanium-karma-client","last_synced_at":"2025-10-10T03:37:10.395Z","repository":{"id":36985475,"uuid":"139603692","full_name":"tidev/titanium-karma-client","owner":"tidev","description":"Karma test runner client for Titanium","archived":false,"fork":false,"pushed_at":"2023-03-04T02:43:47.000Z","size":644,"stargazers_count":2,"open_issues_count":17,"forks_count":2,"subscribers_count":14,"default_branch":"develop","last_synced_at":"2025-09-26T16:47:58.731Z","etag":null,"topics":["karma","npm-package","testing","titanium","unit-testing"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tidev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"tidev","liberapay":"tidev"}},"created_at":"2018-07-03T15:30:17.000Z","updated_at":"2023-01-31T17:01:59.000Z","dependencies_parsed_at":"2024-09-18T16:40:05.429Z","dependency_job_id":null,"html_url":"https://github.com/tidev/titanium-karma-client","commit_stats":null,"previous_names":["appcelerator/titanium-karma-client"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/tidev/titanium-karma-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidev%2Ftitanium-karma-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidev%2Ftitanium-karma-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidev%2Ftitanium-karma-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidev%2Ftitanium-karma-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tidev","download_url":"https://codeload.github.com/tidev/titanium-karma-client/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidev%2Ftitanium-karma-client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002620,"owners_count":26083425,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["karma","npm-package","testing","titanium","unit-testing"],"created_at":"2025-05-13T18:33:18.251Z","updated_at":"2025-10-10T03:37:10.381Z","avatar_url":"https://github.com/tidev.png","language":"JavaScript","funding_links":["https://github.com/sponsors/tidev","https://liberapay.com/tidev"],"categories":[],"sub_categories":[],"readme":"# Karma client for Titanium\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/appcelerator/titanium-karma-client.svg)](https://greenkeeper.io/)\n\n\u003e Axway Titanium version of the Karma client\n\n## Installation\n\n```\nnpm i titanium-karma-client -S\n```\n\n## Usage\n\n\u003e :bulb: If you just want to run unit tests consider using the [karma-titanium-launcher](https://github.com/appcelerator/karma-titanium-launcher) wich makes use of this package and does all the required setup for you to test your projects.\n\nThis client connects to a Karma server, loads all required files including the testing framework and individual unit tests, executes the tests and then reports the results back to the Karma server. This client is heavily inspired by the default Karma Web client that is used for Browser testing and was adapted to work inside Titanium.\n\nYou create a client by instantiating `KarmaClient`, passing it the URL it should connect to. After that you do the actual connect and can optionally bind a few events to listen for status changes.\n\n```js\nimport KarmaClient from 'titanium-karma-client';\nconst client = new KarmaClient({ url: 'http://localhost:9876/?id=123456' });\nclient.connect();\nclient.on('execute', () =\u003e console.log('Loading files ...'));\nclient.on('result', e =\u003e console.log(`Running tests (${e.completed} / ${e.total})`));\nclient.on('complete', e =\u003e {\n\tlet resultMessage = `Executed ${e.total - e.skipped} / ${e.total}`;\n\tif (e.failed) {\n\t\tresultMessage += ` (${e.failed} FAILED)`;\n\t}\n\tresultMessage += ' - DONE';\n\tconsole.log(resultMessage);\n});\n```\n\n## Public API\n\n### new KarmaClient(options)\n\nCreates a new KarmaClient instance and sets the passed options. The options object can contain the following settings:\n\n| Name | Type | Required | Description |\n| --- | --- | --- | --- |\n| `url` | `Sring` | Yes | The base url of the Karma server to connect to. If the URL contains an `id` query parameter the client will register to the Karma server using this identifer. If the parameter is missing the client generates a random identifier to connect with. |\n| `singleRun` | `Boolean` | No | Disconnect the client from the Karma server after a single run. Used in consuction with the Karma config of the same name. Defaults to false. |\n\n### KarmaClient.connect()\n\nConnects to the Karma server and starts the test run.\n\n### KarmaClient.disconnect()\n\nDisconnects the client from the Karma server.\n\n### Event API\n\n`KarmaClient` implements the Node event emitter API. Refer to https://nodejs.org/api/events.html for a full API documention.\n\n## Events\n\nYou can listen to a set of events to respond to certain status changes using the `on` method. Available events are:\n\n* `execute` Emitted when the Karma server sends the `execute` message. This will cause the client to start loading all required files for the test run from the Karma server.\n* `result` This event will be emitted when the client reports a test result back to Karma. The event will include information about the current number of completed tests as well as the total number of tests being executed.\n  * `completed` `\u003cNumber\u003e` The number of completed tests\n  * `total` `\u003cNumber\u003e` The number of total tests in this test run\n* `complete` Emitted when the test run is complete. Includes information about skipped and failed tests and the total number of tests executed.\n  * `skipped` `\u003cNumber\u003e` Number of skipped tests\n  * `failed` `\u003cNumber\u003e` Number of failed tests\n  * `total` `\u003cNumber\u003e` Total tests executed during this run\n\n## Contributions\n\nOpen source contributions are greatly appreciated! If you have a bugfix, improvement or new feature, please create\n[an issue](https://github.com/appcelerator/titanium-karma-client/issues/new) first and submit a [pull request](https://github.com/appcelerator/titanium-karma-client/compare) against master.\n\n## Getting Help\n\nIf you have questions about unit testing your Titanium apps or libraries with Karma, feel free to reach out on Stackoverflow or the\n`#helpme` channel on [TiSlack](http://tislack.org). In case you find a bug related to this library, create a [new issue](https://github.com/appcelerator/titanium-karma-client/issues/new)\nor open a [new JIRA ticket](https://jira.appcelerator.org).\n\n## License\n\nApache License, Version 2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftidev%2Ftitanium-karma-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftidev%2Ftitanium-karma-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftidev%2Ftitanium-karma-client/lists"}