{"id":19365445,"url":"https://github.com/harrysolovay/babel-microtest","last_synced_at":"2026-05-13T13:40:40.900Z","repository":{"id":89795476,"uuid":"169147366","full_name":"harrysolovay/babel-microtest","owner":"harrysolovay","description":"🔬Framework-agnostic, minimal testing for Babel 7 plugins","archived":false,"fork":false,"pushed_at":"2019-02-05T03:07:53.000Z","size":187,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-16T10:33:52.318Z","etag":null,"topics":["babel","compiler","plugin","testing","transform"],"latest_commit_sha":null,"homepage":"","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/harrysolovay.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-04T20:46:38.000Z","updated_at":"2021-02-18T19:18:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"b268af9d-e00e-4fa1-85c7-44988ec7f740","html_url":"https://github.com/harrysolovay/babel-microtest","commit_stats":{"total_commits":12,"total_committers":1,"mean_commits":12.0,"dds":0.0,"last_synced_commit":"866c6c122d5f3a367a20c257efc945a14c0b90b9"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harrysolovay%2Fbabel-microtest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harrysolovay%2Fbabel-microtest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harrysolovay%2Fbabel-microtest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harrysolovay%2Fbabel-microtest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/harrysolovay","download_url":"https://codeload.github.com/harrysolovay/babel-microtest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240483730,"owners_count":19808636,"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":["babel","compiler","plugin","testing","transform"],"created_at":"2024-11-10T07:40:25.603Z","updated_at":"2026-05-13T13:40:35.877Z","avatar_url":"https://github.com/harrysolovay.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# babel-microtest\n\n[![Build Status](https://travis-ci.org/harrysolovay/babel-microtest.svg?branch=master)](https://travis-ci.org/harrysolovay/babel-microtest)\n\n`babel-microtest` is a way of checking that your Babel 7 presets/plugins transform code as expected. It was created to solve **2 key problems** relating to plugin development:\n\n1. interoperability with any testing framework\n2. code comparison (avoiding test failure over negligible differences such as semicolons and line breaks)\n\n## Installation\n\n```shell\n$ npm i -D babel-microtest\n```\n\n## Usage\n\n`my-test.js`\n\n```js\n// use whatever your favorite testing framework (this demo uses Ava)\nimport test from 'ava'\n\n// import the lib\nimport createTest from 'babel-microtest'\n\n// test options (in this case, we're gonna test 'babel-plugin-implicit-return'):\nconst options = {\n  plugins: ['implicit-return'], // or import and pass the plugin directly\n}\n\n// create the test instance\nconst implicitReturnTest = createTest(options)\n\n// using Ava\ntest('implicit return test title', t =\u003e {\n  implicitReturnTest(\n    {\n      source: `\n        function add(a, b) {\n          a + b\n        }\n      `,\n      expected: `\n        function add(a, b) {\n          return a + b\n        }\n      `,\n    },\n    t,\n  )\n})\n\n// ^ we pass `t` as the 2nd argument, but could substitute it with any\n// object containing the testing framework's pass and fail fns\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharrysolovay%2Fbabel-microtest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fharrysolovay%2Fbabel-microtest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharrysolovay%2Fbabel-microtest/lists"}