grunt-jse v0.2.1
grunt-jse
Generator for JSE
Currently, it can generate the module class file, the test spec for jasmine and the import for the test
Getting Started
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');
The "jse" task
Overview
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: {}
},
})
Options
options.srcDir
Type: String
Default value: 'test/spec'
A string value that is used as a base path for the src directory of the JSE modules.
options.specDir
Type: String
Default value: 'src'
A string value that is used as a base path for the jasmine spec directory of the JSE modules.
Usage Examples
Default Options
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
Command line options
Generate a singleton module
grunt jse --class=Awesome.Module --singleton
Skip the module file (only generate test files)
grunt jse --class=Awesome.Module --skip-src
Skip the test files (only generate the class file)
grunt jse --class=Awesome.Module --skip-test