A transform for the lab test framework that enables testing of ES6/JSX modules transpiled with Babel, including code coverage and proper source maps. Current version: 1.1.1 (stable, low activity). This package integrates with lab's -T option to automatically transpile .js, .jsx, .es, and .es6 files (excluding node_modules) using Babel, preserving source maps for accurate error line numbers. Key differentiator: legacy dependency on babel-core (>=4.x.x); not intended for Babel 6+ without manual preset configuration (babel-preset-es2015). Not actively maintained; consider modern alternatives like @babel/register or ts-node.
npm install lab-babelVerified import paths — ran on the pinned version, not inferred.
Install lab-babel with babel-core and es2015 preset, configure .babelrc, write a trivial ES6 test using arrow functions, and run with lab's transform option.
Use @babel/register: npm install --save-dev @babel/core @babel/register @babel/preset-env; lab -T node_modules/@babel/register
Install babel-core: npm install --save-dev babel-core
Ensure your test files are in the project root directory (not in node_modules) and use one of the supported extensions.
Create a .babelrc file with: { "presets": ["es2015"] } or install and configure babel-preset-env.npm install --save-dev babel-core
npm install --save-dev babel-preset-es2015 and ensure .babelrc or package.json babel field includes 'presets': ['es2015']
Use: lab -T node_modules/lab-babel (full path). Ensure tests are .js, .jsx, .es, or .es6 files.
No dependency data recorded yet.