Bootstrap test/spec files for JS.
Bootstrap test/spec files for JS.
$ npm install spec-master -g
Installing globally is recommended but not mandatory.
First, if you haven't already, please read the configuration section.
If no action is specified a list of the modules without specs is printed.
Use the -a option to generate specs for the modules that need then.
The --move option allows you to easily move AMD source files:
- moves the module and spec (if it exists)
- the moving is done in a GIT sensible way (using git mv)
- all the modules and specs are updated with the new path
What move does not do:
- it does work if you don't use git
- it fails big time if relative paths are used
- it only detects top level define/require calls
- it does not change other strings that contains the old module path
spec_master -s confs/spec_master.json6 modules need specs:core/Father.view.jscore/List.view.jscore/functional.helpers.jscore/partials.jscore/project.jscore/string.utils.jsspec_master -s examples/settings.json -aCreating missing 6 specs...c:/Users/lfac/r/spec_master/examples/specs/core/Father.view.jsc:/Users/lfac/r/spec_master/examples/specs/core/project.jsc:/Users/lfac/r/spec_master/examples/specs/core/partials.jsc:/Users/lfac/r/spec_master/examples/specs/core/functional.helpers.jsc:/Users/lfac/r/spec_master/examples/specs/core/List.view.jsc:/Users/lfac/r/spec_master/examples/specs/core/string.utils.jsspec_master --move core/Base.view,core/BaseViewMove was a success
Spec Master requires a configuration file to work. An example:
"src_modules_path" : "modules""src_specs_path" : "specs""spec_template_path" : "spec_template.jstemplate""sufixes_to_exclude" : "emplate.js"
The paths are relative to the configuration file.
By default Spec Master will look for a
settings.json in the current folder
src/main/scripts/spec_master/settings.json (its for Maven projects).
You can also specify the path via the -s option.
The template is compiled using underscore. An example:
define'chai''<%= path %>'"use strict";/*global describe, before, after, beforeEach, afterEach, it, sinon */var expect = chaiexpect;describe'<%= path %>';;
Two variables are passed as the template data.
varName is the recommended variable name for
the module and
path is its path inside
(The MIT License)
Copyright (c) 2013 Luis Cardoso <firstname.lastname@example.org>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.