{"id":19000,"library":"babel-helper-transform-fixture-test-runner","title":"babel-helper-transform-fixture-test-runner","description":"Internal Babel helper that provides a test runner for fixture-based tests within Babel's own monorepo. It is used in conjunction with babel-helper-fixtures to run transformation tests on a set of input/output fixtures. Current stable version is 6.26.2 (an older Babel 6 era package). Release cadence is tied to Babel releases. This package is not intended for direct use by consumers; it's an internal dependency for Babel development. Key differentiator: it is specific to Babel's test infrastructure and not a general-purpose testing utility.","status":"maintenance","version":"6.26.2","language":"javascript","source_language":"en","source_url":"https://github.com/babel/babel/tree/master/packages/babel-helper-transform-fixture-test-runner","tags":["javascript"],"install":[{"cmd":"npm install babel-helper-transform-fixture-test-runner","lang":"bash","label":"npm"},{"cmd":"yarn add babel-helper-transform-fixture-test-runner","lang":"bash","label":"yarn"},{"cmd":"pnpm add babel-helper-transform-fixture-test-runner","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This is an internal Babel package. In Babel 6 era, it likely uses CommonJS. For Babel 7+, this package may be scoped under @babel/helper-transform-fixture-test-runner.","wrong":"const run = require('babel-helper-transform-fixture-test-runner')","symbol":"default","correct":"import run from 'babel-helper-transform-fixture-test-runner'"},{"note":"Since this package is typically used in Node.js test environments, CommonJS require is common. ESM imports may not work due to lack of ESM exports.","wrong":"import run from 'babel-helper-transform-fixture-test-runner'","symbol":"run","correct":"const run = require('babel-helper-transform-fixture-test-runner')"},{"note":"If the package exports a named function 'run', destructuring is preferred. The exact export pattern may vary by version.","wrong":"const run = require('babel-helper-transform-fixture-test-runner').run","symbol":"run","correct":"const { run } = require('babel-helper-transform-fixture-test-runner')"}],"quickstart":{"code":"const run = require('babel-helper-transform-fixture-test-runner');\nconst path = require('path');\nconst testDir = path.join(__dirname, 'fixtures');\nconst opts = {\n  presets: ['@babel/preset-env'],\n  // Additional babel options\n};\nrun(testDir, opts, function (err, results) {\n  if (err) {\n    console.error('Test failed:', err);\n  } else {\n    results.forEach(result => {\n      console.log(result.title, result.pass ? 'PASS' : 'FAIL');\n    });\n  }\n});","lang":"javascript","description":"Demonstrates how to use the runner with a fixture directory and custom babel options."},"warnings":[{"fix":"Upgrade to the scoped @babel/helper-transform-fixture-test-runner package if using Babel 7+.","message":"This package is part of Babel 6 and may not receive updates. Babel 7+ uses @babel/helper-transform-fixture-test-runner.","severity":"deprecated","affected_versions":"6.26.2"},{"fix":"Use Babel's official testing utilities like @babel/helper-plugin-test-runner instead.","message":"In Babel 8, the package may be removed or renamed. Do not rely on this package for production code.","severity":"breaking","affected_versions":">=8.0.0"},{"fix":"Follow Babel's fixture convention: input.js and output.js in a test case folder. Refer to Babel's own test fixtures for examples.","message":"The package expects fixtures in a specific directory structure. Incorrect fixture layout will cause silent failures or no tests run.","severity":"gotcha","affected_versions":">=6.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Install from npm: npm install babel-helper-transform-fixture-test-runner --save-dev, or switch to the scoped @babel/helper-transform-fixture-test-runner if using Babel 7+.","cause":"Package not installed or missing from node_modules. This package is an internal Babel dependency and not published to npm for general use.","error":"Error: Cannot find module 'babel-helper-transform-fixture-test-runner'"},{"fix":"Use: const { run } = require('babel-helper-transform-fixture-test-runner');","cause":"Attempting to use the package without proper import or require. The exported value may be an object with a 'run' method.","error":"TypeError: run is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}