yeoman-test 1.7.1 → 1.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js CHANGED
@@ -136,12 +136,10 @@ exports.mockLocalConfig = function (generator, localConfig) {
136
136
  * Create a simple, dummy generator
137
137
  */
138
138
 
139
- exports.createDummyGenerator = function () {
140
- return Generator.extend({
141
- test: function () {
142
- this.shouldRun = true;
143
- }
144
- });
139
+ exports.createDummyGenerator = () => class extends Generator {
140
+ test() {
141
+ this.shouldRun = true;
142
+ }
145
143
  };
146
144
 
147
145
  /**
@@ -21,6 +21,8 @@ var TestAdapter = require('./adapter').TestAdapter;
21
21
  * 'gen:test' in all cases
22
22
  * @param {Object} [settings]
23
23
  * @param {Boolean} [settings.tmpdir=true] - Automatically run this generator in a tmp dir
24
+ * @param {String} [settings.resolved] - File path to the generator (only used if Generator is a constructor)
25
+ * @param {String} [settings.namespace='gen:test'] - Namespace (only used if Generator is a constructor)
24
26
  * @return {this}
25
27
  */
26
28
 
@@ -34,7 +36,7 @@ var RunContext = module.exports = function RunContext(Generator, settings) {
34
36
  this.localConfig = null;
35
37
  this.dependencies = [];
36
38
  this.Generator = Generator;
37
- this.settings = _.extend({ tmpdir: true }, settings);
39
+ this.settings = _.extend({ tmpdir: true, namespace: 'gen:test' }, settings);
38
40
  this.withOptions({
39
41
  force: true,
40
42
  skipCache: true,
@@ -83,8 +85,8 @@ RunContext.prototype._run = function () {
83
85
  namespace = this.env.namespace(this.Generator);
84
86
  this.env.register(this.Generator);
85
87
  } else {
86
- namespace = 'gen:test';
87
- this.env.registerStub(this.Generator, namespace);
88
+ namespace = this.settings.namespace;
89
+ this.env.registerStub(this.Generator, namespace, this.settings.resolved);
88
90
  }
89
91
 
90
92
  this.generator = this.env.create(namespace, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yeoman-test",
3
- "version": "1.7.1",
3
+ "version": "1.9.1",
4
4
  "description": "Test utilities for Yeoman generators",
5
5
  "homepage": "http://yeoman.io/authoring/testing.html",
6
6
  "author": "The Yeoman Team",
@@ -21,7 +21,7 @@
21
21
  "gulp-exclude-gitignore": "^1.0.0",
22
22
  "gulp-istanbul": "^1.1.2",
23
23
  "gulp-mocha": "^5.0.0",
24
- "gulp-nsp": "^2.4.0",
24
+ "gulp-nsp": "^3.0.1",
25
25
  "gulp-plumber": "^1.0.0"
26
26
  },
27
27
  "scripts": {
@@ -30,13 +30,13 @@
30
30
  },
31
31
  "license": "MIT",
32
32
  "dependencies": {
33
- "inquirer": "^3.0.1",
34
- "lodash": "^4.3.0",
33
+ "inquirer": "^5.2.0",
34
+ "lodash": "^4.17.10",
35
35
  "mkdirp": "^0.5.1",
36
36
  "pinkie-promise": "^2.0.1",
37
37
  "rimraf": "^2.4.4",
38
- "sinon": "^2.3.6",
39
- "yeoman-environment": "^2.0.0",
38
+ "sinon": "^5.0.7",
39
+ "yeoman-environment": "^2.3.0",
40
40
  "yeoman-generator": "^2.0.5"
41
41
  }
42
42
  }