Skip to content

Commit 07533a6

Browse files
committed
chore(gen): update yeoman test/assert
1 parent 947b68b commit 07533a6

File tree

3 files changed

+26
-30
lines changed

3 files changed

+26
-30
lines changed

Diff for: package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@
8484
"run-sequence": "^1.2.1",
8585
"shelljs": "^0.7.5",
8686
"should": "^11.1.0",
87-
"yeoman-assert": "^2.0.0",
88-
"yeoman-test": "~1.5.0"
87+
"yeoman-assert": "^3.0.0",
88+
"yeoman-test": "~1.6.0"
8989
},
9090
"peerDependencies": {
9191
"yo": ">= 1.7.1"

Diff for: src/test/endpoint.test.js

+23-27
Original file line numberDiff line numberDiff line change
@@ -38,33 +38,29 @@ function runEndpointGen(name, opt={}) {
3838
let options = opt.options || {};
3939
let config = opt.config;
4040

41-
return new Promise((resolve, reject) => {
42-
let dir;
43-
let gen = helpers
44-
.run(require.resolve('../generators/endpoint'))
45-
.inTmpDir(function(_dir) {
46-
// this will create a new temporary directory for each new generator run
47-
var done = this.async();
48-
if(DEBUG) console.log(`TEMP DIR: ${_dir}`);
49-
dir = _dir;
50-
51-
// symlink our dependency directories
52-
return fs.symlinkAsync(__dirname + '/fixtures/node_modules', dir + '/node_modules')
53-
.then(done);
54-
})
55-
.withOptions(options)
56-
.withArguments([name])
57-
.withPrompts(prompts);
58-
59-
if(config) {
60-
gen
61-
.withLocalConfig(config);
62-
}
63-
41+
let dir;
42+
let gen = helpers
43+
.run(require.resolve('../generators/endpoint'))
44+
.inTmpDir(function(_dir) {
45+
// this will create a new temporary directory for each new generator run
46+
var done = this.async();
47+
if(DEBUG) console.log(`TEMP DIR: ${_dir}`);
48+
dir = _dir;
49+
50+
// symlink our dependency directories
51+
return fs.symlinkAsync(__dirname + '/fixtures/node_modules', dir + '/node_modules')
52+
.then(done);
53+
})
54+
.withOptions(options)
55+
.withArguments([name])
56+
.withPrompts(prompts);
57+
58+
if(config) {
6459
gen
65-
.on('error', reject)
66-
.on('end', () => resolve(dir));
67-
});
60+
.withLocalConfig(config);
61+
}
62+
63+
return gen;
6864
}
6965

7066
let eslintCmd = path.join(TEST_DIR, '/fixtures/node_modules/.bin/eslint');
@@ -105,7 +101,7 @@ describe('angular-fullstack:endpoint', function() {
105101
_config['generator-angular-fullstack'].insertSockets = false;
106102
_config['generator-angular-fullstack'].insertModels = false;
107103
config = _config;
108-
})
104+
}),
109105
]);
110106
});
111107

Diff for: src/test/test-helpers.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,5 +119,5 @@ export function runGen(prompts, opts={}) {
119119

120120
if(prompts) gen.withPrompts(prompts);
121121

122-
return gen.toPromise();
122+
return gen;
123123
}

0 commit comments

Comments
 (0)