{"id":19578386,"url":"https://github.com/infinitered/jest-preset-ignite","last_synced_at":"2025-04-27T06:33:20.727Z","repository":{"id":57280406,"uuid":"124412970","full_name":"infinitered/jest-preset-ignite","owner":"infinitered","description":"Glues together TypeScript, React Native, and Jest.","archived":false,"fork":false,"pushed_at":"2019-06-30T02:24:23.000Z","size":17,"stargazers_count":5,"open_issues_count":1,"forks_count":4,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-08-08T15:48:19.745Z","etag":null,"topics":["jest","react-native","typescript"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/infinitered.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":"2018-03-08T15:46:05.000Z","updated_at":"2022-04-26T04:49:53.000Z","dependencies_parsed_at":"2022-09-19T17:20:43.117Z","dependency_job_id":null,"html_url":"https://github.com/infinitered/jest-preset-ignite","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinitered%2Fjest-preset-ignite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinitered%2Fjest-preset-ignite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinitered%2Fjest-preset-ignite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinitered%2Fjest-preset-ignite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/infinitered","download_url":"https://codeload.github.com/infinitered/jest-preset-ignite/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224062742,"owners_count":17249291,"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":["jest","react-native","typescript"],"created_at":"2024-11-11T07:10:59.007Z","updated_at":"2024-11-11T07:10:59.952Z","avatar_url":"https://github.com/infinitered.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jest-preset-ignite\n\nConverts JS into TS within a react-native project.\n\n## Version Supported\n\nVersion 0.6 of this library supports:\n\n| Library      | Version    |\n| ------------ | ---------- |\n| Jest         | 23.6.x     |\n| React Native | 0.56, 0.57 |\n| TypeScript   | 3.x        |\n| Node JS      | 8+         |\n\nVersion 0.5 of this library supports the following configuration:\n\n| Library      | Version          |\n| ------------ | ---------------- |\n| Jest         | 22.x             |\n| React Native | 0.53, 0.54, 0.55 |\n| TypeScript   | 2.7.x - 2.9.x    |\n| Node JS      | 8+               |\n\nIt may work on other version, but I haven't tested this.\n\n## Installing\n\nIn a project that contains the aforementioned libraries and versions, run this bad boy:\n\n`yarn add jest-preset-ignite --dev`\n\nThen open your `package.json` and change the `jest` section to use this preset.\n\n```json\n  \"jest\": {\n    \"preset\": \"jest-preset-ignite\"\n  }\n```\n\nYou will also need a `test/setup.ts` file. This will be run first when the test\nenvironment boots up. You can use this for any custom mocks or setup.\n\n## TypeScript Compiler Settings\n\nThis will use it's own \"`tsconfig.json`\" and not the one from your project.\n\nHere's a brief explanation on the compiler settings used. This WILL be on the test!\n\n```js\n{\n  // We are able to target something higher because whatever we emit\n  // will still be run through ye olde babel.\n  target: \"es2017\",\n\n  // We are running this within node, so commonjs is our only option (for now!)\n  module: \"commonjs\",\n\n  // I believe that `react-native` is more for historical reasons. This works.\n  jsx: \"react\",\n\n  // This is not something we can escape at the moment unfortunately. Some libraries\n  // (such as react-native-i18n, moment, validate.js) have their typings already using\n  // the broken way.\n  allowSyntheticDefaultImports: true,\n\n  // Related to the option above, and new in TypeScript 2.7, this furthers support for the\n  // broken way to import default modules.\n  esModuleInterop: true,\n\n  // Let TypeScript's compiler know we'll be needing source maps.\n  sourceMap: true\n}\n```\n\n## Prior Art\n\nThanks to https://github.com/petester42/jest-preset-typescript-react-native for showing me how this is done.\n\nThat project appears to be no longer active, so this picks up from there.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfinitered%2Fjest-preset-ignite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finfinitered%2Fjest-preset-ignite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfinitered%2Fjest-preset-ignite/lists"}