{"id":16486098,"url":"https://github.com/roziscoding/jest-ts-tocompile","last_synced_at":"2025-10-11T20:33:23.401Z","repository":{"id":57280518,"uuid":"448117835","full_name":"roziscoding/jest-ts-tocompile","owner":"roziscoding","description":null,"archived":false,"fork":false,"pushed_at":"2022-01-14T22:56:16.000Z","size":74,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-27T02:55:47.534Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/roziscoding.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-01-14T21:56:40.000Z","updated_at":"2022-02-15T13:15:06.000Z","dependencies_parsed_at":"2022-09-19T17:11:26.194Z","dependency_job_id":null,"html_url":"https://github.com/roziscoding/jest-ts-tocompile","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roziscoding%2Fjest-ts-tocompile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roziscoding%2Fjest-ts-tocompile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roziscoding%2Fjest-ts-tocompile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roziscoding%2Fjest-ts-tocompile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roziscoding","download_url":"https://codeload.github.com/roziscoding/jest-ts-tocompile/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241279339,"owners_count":19938083,"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":[],"created_at":"2024-10-11T13:28:20.895Z","updated_at":"2025-10-11T20:33:18.379Z","avatar_url":"https://github.com/roziscoding.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"jes-ts-tocompile\n---\n\nCustom Jest matcher for testing if a typescript file compiles.\n\n## Installation\n\n1. Install with npm \n\n```sh\nnpm i jest-ts-tocompile\n```\n\n2. Import and install `jest-ts-tocompile` in your jest [setup file](https://jestjs.io/docs/configuration#setupfilesafterenv-array).\n\n```js\nconst toCompile = require('jest-ts-tocompile');\n\ntoCompile.install();\n```\n\n### With TypeScript\n\nWhen using typescript, you need to add the jest type augmentations to your project. In order to do this, create a `jest.d.ts` file in your project root and add the following code:\n\n```ts\ndeclare namespace jest {\n  interface Matchers\u003cR\u003e {\n    toCompile(): R;\n  }\n}\n```\n\n## Usage\n\nYou can call `expect` passing the file path of the typescript file to test and then call `.toCompile()` to test if the file compiles.\n\n```typescript\nimport path from 'path';\n\ndescribe('example files are correct', () =\u003e {\n   it('should compile', () =\u003e {\n      expect(path.join(__dirname, './example.ts')).toCompile();\n   });\n})\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froziscoding%2Fjest-ts-tocompile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froziscoding%2Fjest-ts-tocompile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froziscoding%2Fjest-ts-tocompile/lists"}