Gathering detailed insights and metrics for grunt-template-jasmine-requirejs
Gathering detailed insights and metrics for grunt-template-jasmine-requirejs
Gathering detailed insights and metrics for grunt-template-jasmine-requirejs
Gathering detailed insights and metrics for grunt-template-jasmine-requirejs
grunt-template-jasmine-requirejs-simple
Requirejs template for grunt-contrib-jasmine
grunt-template-jasmine-requirejs-preloader
Requirejs + modulesLoader template for grunt-contrib-jasmine + preload plugins
@radum/grunt-template-jasmine-requirejs
Requirejs template for grunt-contrib-jasmine, works with Grunt v1
grunt-contrib-jasmine-requirejs-template
This is a template for the grunt task `grunt-contrib-jasmine`
RequireJS template for grunt-contrib-jasmine task
npm install grunt-template-jasmine-requirejs
Typescript
Module System
Node Version
NPM Version
JavaScript (98.01%)
HTML (1.99%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
110 Stars
112 Commits
96 Forks
7 Watchers
1 Branches
20 Contributors
Updated on Jan 02, 2025
Latest Version
0.2.3
Package Id
grunt-template-jasmine-requirejs@0.2.3
Size
90.82 kB
NPM Version
2.5.1
Node Version
0.12.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
By default, this template works with Jasmine 2.x
npm install grunt-template-jasmine-requirejs --save-dev
You'd install ~0.1
version of this template if your test specs are based on Jasmine 1.x
npm install grunt-template-jasmine-requirejs@~0.1 --save-dev
Type: String|Array
Works same as original. But they are loaded before require.js script file
Type: String|Array
Works same as original. But they are loaded after require.js script file
Type: String
Options: 2.0.0
to 2.1.10
or path to a local file system version(relative to Gruntfile.js). Absolute path is allowed as well. Default: latest requirejs version included
The version of requirejs to use.
Type String
or Array
This can be a single path to a require config file or an array of paths to multiple require config files. The configuration is extracted from the require.config({}) call(s) in the file, and is passed into the require.config({}) call in the template.
Files are loaded from left to right (using a deep merge). This is so you can have a main config and then override specific settings in additional config files (like a test config) without having to duplicate entire requireJS configs.
If requireConfig
is also specified then it will be deep-merged onto the settings specified by this directive.
Type: Object
This object is JSON.stringify()
-ed ( support serialize Function object ) into the template and passed into var require
variable
If requireConfigFile
is specified then it will be loaded first and the settings specified by this directive will be deep-merged onto those.
1// Example configuration using a single requireJS config file
2grunt.initConfig({
3 connect: {
4 test : {
5 port : 8000
6 }
7 },
8 jasmine: {
9 taskName: {
10 src: 'src/**/*.js',
11 options: {
12 specs: 'spec/*Spec.js',
13 helpers: 'spec/*Helper.js',
14 host: 'http://127.0.0.1:8000/',
15 template: require('grunt-template-jasmine-requirejs'),
16 templateOptions: {
17 requireConfigFile: 'src/main.js'
18 }
19 }
20 }
21 }
22});
1// Example configuration using an inline requireJS config 2grunt.initConfig({ 3 connect: { 4 test : { 5 port : 8000 6 } 7 }, 8 jasmine: { 9 taskName: { 10 src: 'src/**/*.js', 11 options: { 12 specs: 'spec/*Spec.js', 13 helpers: 'spec/*Helper.js', 14 host: 'http://127.0.0.1:8000/', 15 template: require('grunt-template-jasmine-requirejs'), 16 templateOptions: { 17 requireConfig: { 18 baseUrl: 'src/', 19 paths: { 20 "jquery": "path/to/jquery" 21 }, 22 shim: { 23 'foo': { 24 deps: ['bar'], 25 exports: 'Foo', 26 init: function (bar) { 27 return this.Foo.noConflict(); 28 } 29 } 30 }, 31 deps: ['jquery'], 32 callback: function($) { 33 // do initialization stuff 34 /* 35 36 */ 37 } 38 } 39 } 40 } 41 } 42 } 43});
1// Example using a base requireJS config file and specifying 2// overrides with an inline requireConfig file. 3grunt.initConfig({ 4 connect: { 5 test : { 6 port : 8000 7 } 8 }, 9 jasmine: { 10 taskName: { 11 src: 'src/**/*.js', 12 options: { 13 specs: 'spec/*Spec.js', 14 helpers: 'spec/*Helper.js', 15 host: 'http://127.0.0.1:8000/', 16 template: require('grunt-template-jasmine-requirejs'), 17 templateOptions: { 18 requireConfigFile: 'src/main.js', 19 requireConfig: { 20 baseUrl: 'overridden/baseUrl', 21 shim: { 22 // foo will override the 'foo' shim in main.js 23 'foo': { 24 deps: ['bar'], 25 exports: 'Foo' 26 } 27 } 28 } 29 } 30 } 31 } 32 } 33});
1// Example using a multiple requireJS config files. Useful for
2// testing.
3grunt.initConfig({
4 connect: {
5 test : {
6 port : 8000
7 }
8 },
9 jasmine: {
10 taskName: {
11 src: 'src/**/*.js',
12 options: {
13 specs: 'spec/*Spec.js',
14 helpers: 'spec/*Helper.js',
15 host: 'http://127.0.0.1:8000/',
16 template: require('grunt-template-jasmine-requirejs'),
17 templateOptions: {
18 requireConfigFile: ['src/config.js', 'spec/config.js']
19 requireConfig: {
20 baseUrl: 'overridden/baseUrl'
21 }
22 }
23 }
24 }
25 }
26});
Note the usage of the 'connect' task configuration. You will need to use a task like grunt-contrib-connect if you need to test your tasks on a running server.
If you end up using this template, it's worth looking at the
source in order to familiarize yourself with how it loads your files. The load process
consists of a series of nested require
blocks, incrementally loading your source and specs:
1require([*YOUR SOURCE*], function() { 2 require([*YOUR SPECS*], function() { 3 require([*GRUNT-CONTRIB-JASMINE FILES*], function() { 4 // at this point your tests are already running. 5 } 6 } 7}
If "callback" function is defined in requireConfig, above code will be injected to the end of body of "callback" definition
1templateOptions: { 2 callback: function() { 3 // suppose we define a module here 4 define("config", { 5 "endpoint": "/path/to/endpoint" 6 }) 7 } 8}
Generated runner page with require configuration looks like:
1var require = { 2 ... 3 callback: function() { 4 // suppose we define a module here 5 define("config", { 6 "endpoint": "/path/to/endpoint" 7 }) 8 9 require([*YOUR SOURCE*], function() { 10 require([*YOUR SPECS*], function() { 11 require([*GRUNT-CONTRIB-JASMINE FILES*], function() { 12 // at this point your tests are already running. 13 } 14 } 15 } 16 } 17 ... 18}
This automation can help to avoid unexpected dependency order issue
grunt-contrib-jasmine
0.6.x, added requirejs 2.1.9 & 2.1.10No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
Found 3/28 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
license file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More