{"id":27452184,"url":"https://github.com/ocassio/testcafe-reporter-custom","last_synced_at":"2025-04-15T11:41:49.220Z","repository":{"id":35142765,"uuid":"212293668","full_name":"ocassio/testcafe-reporter-custom","owner":"ocassio","description":"TestCafe reporter that allows you to provide your own logic","archived":false,"fork":false,"pushed_at":"2024-06-20T20:39:51.000Z","size":716,"stargazers_count":3,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-05T22:32:04.448Z","etag":null,"topics":["javascript","testcafe","testcafe-reporter","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/testcafe-reporter-custom","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ocassio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2019-10-02T08:47:58.000Z","updated_at":"2023-01-31T17:36:37.000Z","dependencies_parsed_at":"2024-03-08T17:48:23.837Z","dependency_job_id":"893d017c-54c5-44e8-9bf2-4542c0256d31","html_url":"https://github.com/ocassio/testcafe-reporter-custom","commit_stats":{"total_commits":55,"total_committers":3,"mean_commits":"18.333333333333332","dds":0.2727272727272727,"last_synced_commit":"0b7ef4c7328fa305e864222a9a05fb21e4ee6f8a"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocassio%2Ftestcafe-reporter-custom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocassio%2Ftestcafe-reporter-custom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocassio%2Ftestcafe-reporter-custom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocassio%2Ftestcafe-reporter-custom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ocassio","download_url":"https://codeload.github.com/ocassio/testcafe-reporter-custom/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249063432,"owners_count":21206912,"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","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":["javascript","testcafe","testcafe-reporter","typescript"],"created_at":"2025-04-15T11:41:48.686Z","updated_at":"2025-04-15T11:41:49.212Z","avatar_url":"https://github.com/ocassio.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# testcafe-reporter-custom\n\n\nThis is the **custom** reporter plugin for [TestCafe](http://devexpress.github.io/testcafe).\n\n## Install\n\n```sh\nnpm install testcafe-reporter-custom\n```\n\n## Usage\n\nWhen you run tests from the command line, specify the reporter name by using the `--reporter` option:\n\n```sh\ntestcafe chrome 'path/to/test/file.js' --reporter custom\n```\n\n\nWhen you use API, pass the reporter name to the `reporter()` method:\n\n```js\ntestCafe\n    .createRunner()\n    .src('path/to/test/file.js')\n    .browsers('chrome')\n    .reporter('custom') // \u003c-\n    .run();\n```\n\n\nAfter that you can define your custom logic in `reporter/index.js` file.  \nIt can be defined as an object or factory function.\n\nFor example:\n\n```js\nmodule.exports = function () {\n    return {\n        async reportTaskStart(/* startTime, userAgents, testCount */) {\n            throw new Error('Not implemented');\n        },\n\n        async reportFixtureStart(/* name, path, meta */) {\n            throw new Error('Not implemented');\n        },\n\n        async reportTestStart(/* name, meta */) {\n            // NOTE: This method is optional.\n        },\n\n        async reportTestDone(/* name, testRunInfo, meta */) {\n            throw new Error('Not implemented');\n        },\n\n        async reportTaskDone(/* endTime, passed, warnings, result */) {\n            throw new Error('Not implemented');\n        }\n    };\n}\n```\n\nAPI is completely the same as for regular reporter.\n\n## Configuration\n\nReporter can be configured using `reporter.config.js` file, which should be placed in a project root folder.\n\n```js\nmodule.exports = {\n    path: 'reporter/main.js'\n};\n```\n\nPossible options are presented in the table below.\n\n| Option       | Default Value            | Description                                                                                                           |\n| ------------ | ------------------------ | --------------------------------------------------------------------------------------------------------------------- |\n| `path`       | `'reporter/index.js'`    | Path to your reporter.                                                                                                |\n| `moduleType` | `'commonjs'`             | Whether your reporter uses CommonJS or ES Modules. Possible values are `commonjs` and `module`.                       |\n| `tsNodePath` | `'node_modules/ts-node'` | Path to your `ts-node` installation (only used for `*.ts` files).                                                     |\n| `tsOptions`  | `undefined`              | [`ts-node` options](https://github.com/TypeStrong/ts-node#cli-and-programmatic-options) (only used for `*.ts` files). |\n\n## TypeScript Usage\n\nIn order to use TypeScript with this reporter, at least `ts-node` and `typescript` packages should be installed.  \n\n```sh\nnpm install --save-dev ts-node typescript\n```\n\nAfter that you need to create `reporter.config.ts` file and specify `path` to your reporter.\n```js\nmodule.exports = {\n    path: 'reporter/index.ts'\n};\n```\n\nAs `testcafe-reporter-custom` use `ts-node` in order to execute TypeScript files, all it's rules are applied.\n\nIf you want to provide additional `ts-node` options, you can use `tsOptions` in the reporter configuration file.  \nFor example, you can specify custom `tsconfig` file using the following configuration:\n\n```js\nmodule.exports = {\n    path: 'reporter/index.ts',\n    tsOptions: {\n        project: 'tsconfig.reporter.json'\n    }\n};\n```\n\n## Usage Examples\n\nThere is a couple of usage examples available in this repository:\n\n* [Basic](examples/basic)\n* [ES Modules](examples/es-modules)\n* [TypeScript](examples/typescript)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Focassio%2Ftestcafe-reporter-custom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Focassio%2Ftestcafe-reporter-custom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Focassio%2Ftestcafe-reporter-custom/lists"}