{"id":26022,"library":"nutra-jasmine-coverage-babel-preset","title":"nutra-jasmine-coverage-babel-preset","description":"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.","status":"active","version":"0.0.10","language":"javascript","source_language":"en","source_url":"https://github.com/m-a-r-c-e-l-i-n-o/nutra-jasmine-coverage-babel-preset","tags":["javascript","N.U.T.R.A.","preset","jasmine","behavior-driven","babel","es6","es7","istanbul"],"install":[{"cmd":"npm install nutra-jasmine-coverage-babel-preset","lang":"bash","label":"npm"},{"cmd":"yarn add nutra-jasmine-coverage-babel-preset","lang":"bash","label":"yarn"},{"cmd":"pnpm add nutra-jasmine-coverage-babel-preset","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required host test runner framework","package":"nutra","optional":false}],"imports":[{"note":"This preset is configured via nutra.config.js, not by direct imports. No symbols are imported in test files.","wrong":null,"symbol":"nutra.config.js (module.exports = function config) { config.set({...}) })","correct":"// nutra.config.js\nmodule.exports = function(config) {\n  config.set({\n    frameworks: ['nutra-jasmine'],\n    files: ['test/specs/**/*.js', 'src/**/*.js'],\n    preprocessors: {\n        'test/specs/**/*.js': ['nutra-babel'],\n        'src/**/*.js': ['nutra-babel', 'nutra-coverage']\n    },\n    reporters: ['nutra-coverage']\n  });\n};"}],"quickstart":{"code":"// Install preset\nnpm install --save-dev nutra nutra-jasmine-coverage-babel-preset\n\n// Create nutra.config.js\nmodule.exports = function(config) {\n  config.set({\n    frameworks: ['nutra-jasmine'],\n    files: ['test/specs/**/*.js', 'src/**/*.js'],\n    preprocessors: {\n        'test/specs/**/*.js': ['nutra-babel'],\n        'src/**/*.js': ['nutra-babel', 'nutra-coverage']\n    },\n    reporters: ['nutra-coverage'],\n    babelOptions: {\n      configFile: './.babelrc'\n    },\n    coverageOptions: {\n      reporters: [{ type: 'html', subdir: '.' }]\n    }\n  });\n};\n\n// Write a sample spec\n// test/specs/exampleSpec.js\ndescribe('Sample', function() {\n  it('should pass', function() {\n    expect(1 + 1).toBe(2);\n  });\n});\n\n// Run tests\nnpx nutra run","lang":"javascript","description":"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."},"warnings":[{"fix":"Use separate Babel preset compatible with Babel 7.","message":"Babel 6 support is deprecated, upgrade to Babel 7 or later.","severity":"deprecated","affected_versions":"<0.1.0"},{"fix":"Ensure both are in devDependencies.","message":"The preset requires both nutra and nutra-jasmine-coverage-babel-preset to be installed as devDependencies.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use CommonJS syntax in nutra.config.js.","message":"The configuration uses CommonJS (module.exports) and is not compatible with ES modules.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use a separate TypeScript preset if needed.","message":"The preset does not support TypeScript; it only transpiles ES6/ES7 JavaScript.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run: npm install --save-dev nutra","cause":"nutra is not installed or not in package.json devDependencies.","error":"Cannot find module 'nutra'"},{"fix":"Run: npm install --save-dev nutra-jasmine-coverage-babel-preset","cause":"nutra-jasmine-coverage-babel-preset is not installed or not registered.","error":"Error: No provider for \"framework:nutra-jasmine\""},{"fix":"Ensure module.exports = function(config) { ... };","cause":"nutra.config.js does not export a function that accepts a config object.","error":"TypeError: config.set is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}