Skip to content

Commit a170fa5

Browse files
authored
Merge pull request #2572 from angular-fullstack/chore/gen-deps
Chore/gen deps
2 parents ee9cecc + 07533a6 commit a170fa5

File tree

5 files changed

+41
-44
lines changed

5 files changed

+41
-44
lines changed

Diff for: circle.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@ jobs:
5656
- ~/generator-angular-fullstack/test/fixtures/node_modules
5757

5858
- run: gulp build
59-
- run: gulp test
59+
- run: npm test

Diff for: gulpfile.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,11 @@ const mocha = lazypipe()
2525
reporter: 'spec',
2626
timeout: 120000,
2727
slow: 500,
28-
globals: {
29-
should: require('should')
30-
},
3128
require: [
32-
'./mocha.conf'
33-
]
29+
'./mocha.conf',
30+
'should'
31+
],
32+
compilers: ['js:babel-core/register']
3433
});
3534

3635
const transpile = lazypipe()

Diff for: package.json

+9-7
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
"url": "git://github.com/angular-fullstack/generator-angular-fullstack.git"
3232
},
3333
"scripts": {
34-
"test": "gulp updateFixtures:test && gulp installFixtures && gulp build && gulp test",
34+
"pre-test": "gulp updateFixtures:test && gulp installFixtures && gulp build",
35+
"test": "mocha --require should --require babel-register --require ./mocha.conf --reporter spec --timeout 120000 test/pre.test.js test/*.test.js",
3536
"prepublish": "gulp build"
3637
},
3738
"dependencies": {
@@ -40,10 +41,10 @@
4041
"chalk": "^1.1.0",
4142
"glob": "^7.0.5",
4243
"gulp-eslint": "^3.0.1",
43-
"gulp-filter": "^4.0.0",
44+
"gulp-filter": "^5.0.0",
4445
"gulp-html2jade": "^1.1.2",
4546
"gulp-rename": "^1.2.2",
46-
"gulp-tap": "^0.1.3",
47+
"gulp-tap": "^1.0.1",
4748
"insight": "~0.8.3",
4849
"jscodeshift": "^0.3.30",
4950
"lodash": "^4.17.0",
@@ -54,11 +55,12 @@
5455
},
5556
"devDependencies": {
5657
"babel-core": "^6.18.2",
57-
"babel-preset-es2015": "^6.18.0",
5858
"babel-plugin-transform-class-properties": "^6.19.0",
5959
"babel-plugin-transform-flow-strip-types": "^6.18.0",
60+
"babel-preset-es2015": "^6.18.0",
6061
"babel-register": "^6.18.0",
6162
"chai": "^3.5.0",
63+
"david": "^11.0.0",
6264
"del": "^2.2.0",
6365
"grunt": "^1.0.1",
6466
"grunt-build-control": "^0.7.0",
@@ -69,7 +71,7 @@
6971
"gulp-conventional-changelog": "^1.1.0",
7072
"gulp-gh-pages": "^0.5.4",
7173
"gulp-if": "^2.0.1",
72-
"gulp-mocha": "^3.0.0",
74+
"gulp-mocha": "^4.3.1",
7375
"gulp-plumber": "^1.1.0",
7476
"gulp-util": "^3.0.7",
7577
"jit-grunt": "~0.10.0",
@@ -82,8 +84,8 @@
8284
"run-sequence": "^1.2.1",
8385
"shelljs": "^0.7.5",
8486
"should": "^11.1.0",
85-
"yeoman-assert": "^2.0.0",
86-
"yeoman-test": "~1.5.0"
87+
"yeoman-assert": "^3.0.0",
88+
"yeoman-test": "~1.6.0"
8789
},
8890
"peerDependencies": {
8991
"yo": ">= 1.7.1"

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

+26-30
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,11 +101,11 @@ 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

112-
describe(`with a generated endpont 'foo'`, function() {
108+
describe(`with a generated endpoint 'foo'`, function() {
113109
var dir;
114110
beforeEach(function() {
115111
return runEndpointGen('foo', {config: config['generator-angular-fullstack']}).then(_dir => {
@@ -131,7 +127,7 @@ describe('angular-fullstack:endpoint', function() {
131127
});
132128
});
133129

134-
describe('with a generated capitalized endpont', function() {
130+
describe('with a generated capitalized endpoint', function() {
135131
var dir;
136132
beforeEach(function() {
137133
return runEndpointGen('Foo', {config: config['generator-angular-fullstack']}).then(_dir => {
@@ -153,7 +149,7 @@ describe('angular-fullstack:endpoint', function() {
153149
});
154150
});
155151

156-
describe('with a generated path name endpont', function() {
152+
describe('with a generated path name endpoint', function() {
157153
var dir;
158154
beforeEach(function() {
159155
return runEndpointGen('foo/bar', {config: config['generator-angular-fullstack']}).then(_dir => {

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)