Registry / testing / nutra-jasmine-coverage-babel-preset

nutra-jasmine-coverage-babel-preset

JSON →
library0.0.10jsnpmunverified

A preset for the N.U.T.R.A. unit test runner combining Jasmine, Babel transpilation, Istanbul code coverage, and CommonJS module loading. Current stable version is 0.0.10. It simplifies configuration by bundling these tools into a single preset. Designed specifically for the N.U.T.R.A. test runner ecosystem, it is not a general-purpose tool.

npm install nutra-jasmine-coverage-babel-preset
INSTALL
IMPORT
SIG · NUTRA-JASMINE-COVE
N
nutra-jasmine-coverage-babel-preset
testingjavascriptv0.0.10
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

nutra.config.js (module.exports = function config) { config.set({...}) })
// nutra.config.js module.exports = function(config) { config.set({ frameworks: ['nutra-jasmine'], files: ['test/specs/**/*.js', 'src/**/*.js'], preprocessors: { 'test/specs/**/*.js': ['nutra-babel'], 'src/**/*.js': ['nutra-babel', 'nutra-coverage'] }, reporters: ['nutra-coverage'] }); };
This preset is configured via nutra.config.js, not by direct imports. No symbols are imported in test files.

Installs the preset, creates a basic nutra.config.js configuration with Jasmine, Babel, and Istanbul coverage, writes a sample spec, and runs the test suite.

// Install preset npm install --save-dev nutra nutra-jasmine-coverage-babel-preset // Create nutra.config.js module.exports = function(config) { config.set({ frameworks: ['nutra-jasmine'], files: ['test/specs/**/*.js', 'src/**/*.js'], preprocessors: { 'test/specs/**/*.js': ['nutra-babel'], 'src/**/*.js': ['nutra-babel', 'nutra-coverage'] }, reporters: ['nutra-coverage'], babelOptions: { configFile: './.babelrc' }, coverageOptions: { reporters: [{ type: 'html', subdir: '.' }] } }); }; // Write a sample spec // test/specs/exampleSpec.js describe('Sample', function() { it('should pass', function() { expect(1 + 1).toBe(2); }); }); // Run tests npx nutra run
Debug
Known issues
deprecatedBabel 6 support is deprecated, upgrade to Babel 7 or later.
fix
Use separate Babel preset compatible with Babel 7.
affects: <0.1.0
gotchaThe preset requires both nutra and nutra-jasmine-coverage-babel-preset to be installed as devDependencies.
fix
Ensure both are in devDependencies.
affects: >=0.0.0
gotchaThe configuration uses CommonJS (module.exports) and is not compatible with ES modules.
fix
Use CommonJS syntax in nutra.config.js.
affects: >=0.0.0
gotchaThe preset does not support TypeScript; it only transpiles ES6/ES7 JavaScript.
fix
Use a separate TypeScript preset if needed.
affects: >=0.0.0
Errors
Common errors & fixes
Cannot find module 'nutra'
nutra is not installed or not in package.json devDependencies.
fix
Run: npm install --save-dev nutra
Error: No provider for "framework:nutra-jasmine"
nutra-jasmine-coverage-babel-preset is not installed or not registered.
fix
Run: npm install --save-dev nutra-jasmine-coverage-babel-preset
TypeError: config.set is not a function
nutra.config.js does not export a function that accepts a config object.
fix
Ensure module.exports = function(config) { ... };
Upgrade
Version history
0.0.10latest on npm
Audit
Dependencies
nutrarequiredRequired host test runner framework
Agent activity
2 hits · last 30 days
node
2
Resources
nutra-jasmine-coverage-babel-preset — npm install nutra-jasmine-coverage-babel-preset · libregistry