Registry / testing / grunt-jasmine-node

grunt-jasmine-node

JSON →
library0.3.1jsnpmunverified

This package provides a Grunt task for integrating Jasmine test suites, specifically leveraging the `jasmine-node` test runner. Its latest version, 0.3.1, was published in 2014, indicating it is an effectively abandoned project. The underlying `jasmine-node` library, which bundled Jasmine 1.3.1 for Node.js environments, itself entered maintenance mode in May 2019 and advises users to migrate to the actively maintained `jasmine` or `jasmine-npm` packages for modern Node.js development. Consequently, `grunt-jasmine-node` lacks compatibility with contemporary Node.js versions, current Grunt releases, and Jasmine versions beyond 1.x (e.g., Jasmine 2.x and 3.x series). Developers seeking to run Jasmine tests within a Grunt workflow should instead consider `grunt-contrib-jasmine`, which is an actively maintained plugin supporting modern Jasmine features and Node.js environments.

npm install grunt-jasmine-node
INSTALL
IMPORT
SIG · GRUNT-JASMINE-NODE
G
grunt-jasmine-node
testingjavascriptv0.3.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.

grunt.loadNpmTasks
grunt.loadNpmTasks('grunt-jasmine-node');
Grunt plugins are loaded into the Gruntfile, not imported via ES modules or CommonJS require for direct use.
Task Configuration
grunt.initConfig({ jasmine_node: { // ... options ... } });
The 'jasmine_node' task is configured within Grunt's `initConfig` object.

Demonstrates how to configure and run the `jasmine_node` task within a Gruntfile to execute Jasmine 1.x tests.

module.exports = function(grunt) { grunt.initConfig({ jasmine_node: { options: { forceExit: true, match: '.', // Match all files in spec directory matchall: false, extensions: 'js', specNameMatcher: 'spec' // Look for files ending with 'spec.js' }, all: ['spec/'] // Directory containing your spec files } }); grunt.loadNpmTasks('grunt-jasmine-node'); grunt.registerTask('test', ['jasmine_node']); // To run: // 1. npm install grunt grunt-jasmine-node jasmine-node --save-dev // 2. Create 'spec' directory and add 'my-test.spec.js' // 3. grunt test };
Debug
Known issues
breakingThis plugin is tied to Jasmine 1.x (specifically 1.3.1 via `jasmine-node`). It does not support features introduced in Jasmine 2.x (e.g., `fit`, `fdescribe`, `beforeAll`, `afterAll`) or later versions, leading to significant compatibility issues with modern test suites.
fix
Migrate to `grunt-contrib-jasmine` (for Jasmine 2.x/3.x support) or use modern test runners directly via npm scripts.
affects: >=0.1.0
breakingThe plugin is likely incompatible with recent Node.js versions (e.g., Node.js 14+). The underlying `jasmine-node` officially supported up to Node.js 12, and this plugin ceased updates even earlier.
fix
Use a Node.js version compatible with the plugin's last known good configuration (likely Node.js <14) or, preferably, migrate to a modern, actively maintained test runner setup.
affects: >=0.1.0
deprecatedThe `jasmine-node` library, which `grunt-jasmine-node` relies upon, is in maintenance mode and explicitly recommends migrating to the official `jasmine` or `jasmine-npm` packages.
fix
Avoid using `jasmine-node` and by extension `grunt-jasmine-node`. Transition to `jasmine` or `jasmine-npm` for Node.js testing, potentially integrated with `grunt-contrib-jasmine` or npm scripts.
affects: >=0.1.0
gotchaThe Grunt ecosystem for test running has largely shifted. More actively maintained alternatives like `grunt-contrib-jasmine` (which uses Headless Chrome for modern Jasmine versions) or direct npm scripts with contemporary test runners are widely preferred.
fix
Evaluate modern Grunt plugins like `grunt-contrib-jasmine` or consider moving away from Grunt entirely for running tests, opting for direct integration with `npm test` scripts.
affects: >=0.1.0
breakingDue to being abandoned for over a decade, this package and its transitively included dependencies are highly susceptible to known but unpatched security vulnerabilities.
fix
Discontinue use immediately and migrate to actively maintained testing solutions to mitigate security risks. Regularly scan new dependencies for vulnerabilities.
affects: >=0.1.0
Errors
Common errors & fixes
Warning: Task "jasmine_node" not found.
The Grunt task was not correctly loaded or installed.
fix
Ensure `npm install grunt-jasmine-node --save-dev` has been run and `grunt.loadNpmTasks('grunt-jasmine-node');` is present in your Gruntfile.js.
TypeError: global.jasmine.getEnv is not a function
This error often occurs when mixing different Jasmine versions or using an older Jasmine API (like 1.x) with code expecting a newer one, or vice-versa. `jasmine-node` uses Jasmine 1.x.
fix
Verify that only one version of Jasmine is being loaded and that your test code is written for Jasmine 1.x. If you require newer Jasmine features, you must migrate to a different plugin or runner.
Cannot find module 'jasmine-node'
The `jasmine-node` package, a dependency of this plugin, was not installed correctly.
fix
Run `npm install jasmine-node --save-dev` (or remove `node_modules` and run `npm install`) to ensure `jasmine-node` is available to the Grunt plugin.
Upgrade
Version history
0.3.1latest on npm
Audit
Dependencies
gruntrequiredRequired as the task runner for this plugin.
jasmine-noderequiredThis plugin wraps jasmine-node to run Jasmine tests. jasmine-node itself is in maintenance mode and deprecated.
Agent activity
19 hits · last 30 days
node
18
Perplexity
1
Resources