Generator for JSE
Currently, it can generate the module class file, the test spec for jasmine and the import for the test
This plugin requires Grunt ~0.4.1
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-jse --save-dev
One the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-jse');
In your project's Gruntfile, add a section named jse
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
jse: {
options: {
srcDir: 'Web Content/maf/jse',
specDir: 'test/spec'
},
default: {}
},
})
Type: String
Default value: 'src'
A string value that is used as a base path for the src directory of the JSE modules.
Type: String
Default value: 'test/spec'
A string value that is used as a base path for the jasmine spec directory of the JSE modules.
In this exemple, we generate files for the class named Awesome.Module
- Add this configuration in your Gruntfile.js (inside the
grunt.initConfig
block)
grunt.initConfig({
jse: {
options: {
srcDir: 'Web Content/maf/jse',
specDir: 'test/spec'
},
default: {}
},
})
- Type in the following command
grunt jse --class=Awesome.Module
All those options are boolean, you should use --singleton=true
instead
of --singleton
as long as there is a bug with the nopt
module
version (< 0.2) in grunt
.
grunt jse --class=Awesome.Module --singleton=true
grunt jse --class=Awesome.Module --skip-src=true
grunt jse --class=Awesome.Module --skip-test=true