Registry / testing / babel-helper-plugin-test-runner

babel-helper-plugin-test-runner

JSON →
library6.24.1jsnpmunverified

Internal Babel helper for running plugin tests. Version 6.24.1 is an older release from Babel 6 era. This package is part of Babel's monorepo and is not intended for direct external use. It provides a test runner helper for Babel plugins. The current stable major version is 7.x (e.g., 7.29.2) with Babel 8 (8.0.0-rc.3) in release candidate. Key differentiator: purely internal to Babel, not designed for public consumption, may have breaking changes across major versions. Use @babel/helper-plugin-test-runner for Babel 7+.

npm install babel-helper-plugin-test-runner
INSTALL
IMPORT
SIG · BABEL-HELPER-PLUGI
B
babel-helper-plugin-test-runner
testingjavascriptv6.24.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import testRunner from 'babel-helper-plugin-test-runner'
const testRunner = require('babel-helper-plugin-test-runner')
CommonJS require works for v6 but discouraged; Babel 7+ uses @babel/helper-plugin-test-runner
default
import testRunner from '@babel/helper-plugin-test-runner'
const testRunner = require('@babel/helper-plugin-test-runner')
For Babel 7+, package renamed to @babel/helper-plugin-test-runner
default
const testRunner = require('@babel/helper-plugin-test-runner')
CJS is still valid for Babel 7+ but ESM preferred

Example of using babel-helper-plugin-test-runner to test a Babel plugin with a code fixture.

import pluginTester from 'babel-helper-plugin-test-runner'; import myPlugin from './my-plugin'; const runTest = pluginTester(myPlugin); const result = runTest({ code: 'const x = 1;', snapshot: true }); console.log(result);
Debug
Known issues
breakingRenamed from babel-helper-plugin-test-runner to @babel/helper-plugin-test-runner in Babel 7. Old package may not receive updates.
fix
Update to @babel/helper-plugin-test-runner for Babel 7+
affects: <7.0.0
deprecatedThe package is internal to Babel and may break without notice across minor versions.
fix
Consider using @babel/core's built-in test utilities or a dedicated test framework like Jest with babel-jest.
affects: >=6.0.0
gotchaCommonJS require() works in v6 but is not the recommended import style; prefer ESM for consistency with modern Babel.
fix
Use import statement or upgrade to Babel 7+ with @babel/helper-plugin-test-runner
affects: 6.x
gotchaThe function exported may have changed signature between Babel 6 and 7; check documentation for your version.
fix
Refer to version-specific docs on GitHub
affects: >=6.0.0
Errors
Common errors & fixes
Cannot find module 'babel-helper-plugin-test-runner'
Package not installed or mistake in package name (should be @babel/helper-plugin-test-runner for Babel 7+).
fix
npm install --save-dev @babel/helper-plugin-test-runner or install the older babel-helper-plugin-test-runner for Babel 6
TypeError: pluginTester is not a function
Incorrect import; the default export is a function, but maybe using named import.
fix
Use import pluginTester from 'babel-helper-plugin-test-runner'
babel-helper-plugin-test-runner is not compatible with @babel/core 7+
Using old package name with new Babel core.
fix
Switch to @babel/helper-plugin-test-runner
Upgrade
Version history
6.24.1latest on npm
Audit
Dependencies
@babel/corerequiredRequired for Babel transformations in tests
Agent activity
16 hits · last 30 days
node
14
OpenAI (training)
2
Resources
babel-helper-plugin-test-runner — npm install babel-helper-plugin-test-runner · libregistry