{"id":15684040,"url":"https://github.com/azu/ts-node-test-register","last_synced_at":"2025-04-14T03:15:44.351Z","repository":{"id":28407864,"uuid":"118334206","full_name":"azu/ts-node-test-register","owner":"azu","description":"Use `test/tsconfig.json` with ts-node for testing.","archived":false,"fork":false,"pushed_at":"2025-04-08T22:02:34.000Z","size":822,"stargazers_count":10,"open_issues_count":4,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-14T03:15:32.661Z","etag":null,"topics":["loader","mocha","node","register","test","testing","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/azu.png","metadata":{"funding":{"github":"azu"},"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":"2018-01-21T12:49:30.000Z","updated_at":"2025-04-08T22:02:37.000Z","dependencies_parsed_at":"2023-10-15T04:55:49.414Z","dependency_job_id":"e90d08fe-e4ac-4325-836a-7f00a3f69b02","html_url":"https://github.com/azu/ts-node-test-register","commit_stats":{"total_commits":283,"total_committers":4,"mean_commits":70.75,"dds":0.5477031802120141,"last_synced_commit":"dbc362ab59de6c5d564324cb117efcef9c9a1805"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azu%2Fts-node-test-register","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azu%2Fts-node-test-register/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azu%2Fts-node-test-register/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azu%2Fts-node-test-register/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/azu","download_url":"https://codeload.github.com/azu/ts-node-test-register/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248813803,"owners_count":21165634,"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":["loader","mocha","node","register","test","testing","typescript"],"created_at":"2024-10-03T17:10:03.926Z","updated_at":"2025-04-14T03:15:44.322Z","avatar_url":"https://github.com/azu.png","language":"TypeScript","funding_links":["https://github.com/sponsors/azu"],"categories":[],"sub_categories":[],"readme":"# ts-node-test-register [![Actions Status: test](https://github.com/azu/ts-node-test-register/workflows/test/badge.svg)](https://github.com/azu/ts-node-test-register/actions?query=workflow%3A\"test\")\n\nUse `test/tsconfig.json` with [ts-node](https://github.com/TypeStrong/ts-node \"ts-node\") for testing.\n\n## Features\n\n### Load `test/tsconfig.json`\n\nThis register library load `tsconfig.json` file by following priority.\n\n- `project/{test}/tsconfig.test.json`\n- `project/{test}/tsconfig.json`\n- `project/tsconfig.test.json`\n- `project/tsconfig.json`\n\n`{test}` is `test` directory by default.\n\nYou can specified the `{test}` by `directories` of `package.json`.\n\n```\n  \"directories\": {\n    \"test\": \"test\"\n  },\n```\n\n**Notes:** Why need to load different `tsconfig.json` between main and test?\n\nIn some times, we use different `tsconfig.json` between main code and test code.\n\nFor example, you can enable `allowJs` in test code.\nIt supports gradual migration that convert JavaScript to TypeScript. \n\n### Type Check by default\n\n\u003cdel\u003e`ts-node`(v4) disable `type-check` by default.\u003c/del\u003e\u003cins\u003eThis behavior is reverted in [v6.0.0](https://github.com/TypeStrong/ts-node/releases/tag/v6.0.0)\u003c/ins\u003e\n\n- [Release \"Fast\" By Default · TypeStrong/ts-node](https://github.com/TypeStrong/ts-node/releases/tag/v4.0.0 \"Release \u0026#34;Fast\u0026#34; By Default · TypeStrong/ts-node\")\n\nThe motivation is based on so not good experience.\n\n- [Type error reporting · Issue #79 · kulshekhar/ts-jest](https://github.com/kulshekhar/ts-jest/issues/79 \"Type error reporting · Issue #79 · kulshekhar/ts-jest\")\n- [test(textlint-formatter): `mocha` runs fine while `tsc` cannot compile the script · Issue #448 · textlint/textlint](https://github.com/textlint/textlint/issues/448 \"test(textlint-formatter): `mocha` runs fine while `tsc` cannot compile the script · Issue #448 · textlint/textlint\")\n\nThis register library supports [Mike Haas](https://github.com/mikehaas763 \"Mike Haas\")'s opinion.\n\n\u003e test code is still code, if there's type errors in such test code, shouldn't it fail?\n\u003e -- \u003chttps://github.com/kulshekhar/ts-jest/issues/79#issuecomment-355397865\u003e\n\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n    npm install ts-node ts-node-test-register --save-dev\n\n:warning: [ts-node](https://github.com/TypeStrong/ts-node \"ts-node\") is [peerDependencies](https://docs.npmjs.com/files/package.json#peerdependencies \"peerDependencies\").  \nYou need to install `ts-node`.\n\n## Usage\n\nUsing with [mocha](https://github.com/mochajs/mocha \"mocha\").\n\n```\nmocha --require ts-node-test-register \"test/**/*.ts\"\n```\n\nOr define `--require ts-node-test-register` to [`.mocharc.{js,json,yml}`](example/.mocharc.json).\n\n```\n├── package.json\n├── .mocharc.json (--require ts-node-test-register)\n├── src\n│   └── index.ts\n└── test\n    ├── tsconfig.json // \u003c= load this tsconfig.json\n    └── index-test.ts\n```\n\nFor more details, see [example](./example/).\n\n## Changelog\n\nSee [Releases page](https://github.com/azu/ts-node-test-register/releases).\n\n## Running tests\n\nInstall devDependencies and Run `yarn test`:\n\n    yarn test\n    yarn run test:example\n\n## Contributing\n\nPull requests and stars are always welcome.\n\nFor bugs and feature requests, [please create an issue](https://github.com/azu/ts-node-test-register/issues).\n\n1. Fork it!\n2. Create your feature branch: `git checkout -b my-new-feature`\n3. Commit your changes: `git commit -am 'Add some feature'`\n4. Push to the branch: `git push origin my-new-feature`\n5. Submit a pull request :D\n\n## Author\n\n- [github/azu](https://github.com/azu)\n- [twitter/azu_re](https://twitter.com/azu_re)\n\n## License\n\nMIT © azu\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazu%2Fts-node-test-register","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fazu%2Fts-node-test-register","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazu%2Fts-node-test-register/lists"}