Skip to content

Commit c70d35a

Browse files
committed
test(gen): add pre-test (check fixtures)
1 parent 93d7cb6 commit c70d35a

File tree

2 files changed

+47
-1
lines changed

2 files changed

+47
-1
lines changed

Diff for: gulpfile.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,6 @@ gulp.task('installFixtures', function() {
164164
});
165165

166166
gulp.task('test', () => {
167-
return gulp.src('test/*.test.js')
167+
return gulp.src(['test/pre.test.js', 'test/*.test.js'])
168168
.pipe(mocha());
169169
});

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

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
'use strict';
2+
import path from 'path';
3+
import fs from 'fs';
4+
import _ from 'lodash';
5+
import Promise from 'bluebird';
6+
Promise.promisifyAll(fs);
7+
import helpers from 'yeoman-test';
8+
import assert from 'yeoman-assert';
9+
import minimatch from 'minimatch';
10+
import * as getExpectedFiles from './get-expected-files';
11+
import {
12+
copyAsync,
13+
runCmd,
14+
assertOnlyFiles,
15+
getConfig
16+
} from './test-helpers';
17+
18+
describe('test fixtures', function() {
19+
it('should have package.json in fixtures', function() {
20+
assert.file([path.join(__dirname, 'fixtures', 'package.json')]);
21+
});
22+
23+
it('should have bower.json in fixtures', function() {
24+
assert.file([path.join(__dirname, 'fixtures', 'bower.json')]);
25+
});
26+
27+
it('should have all npm packages in fixtures/node_modules', function() {
28+
var packageJson = require('./fixtures/package.json');
29+
var deps = Object.keys(packageJson.dependencies);
30+
deps = deps.concat(Object.keys(packageJson.devDependencies));
31+
deps = deps.map(function(dep) {
32+
return path.join(__dirname, 'fixtures', 'node_modules', dep);
33+
});
34+
assert.file(deps);
35+
});
36+
37+
it('should have all bower packages in fixtures/bower_components', function() {
38+
var bowerJson = require('./fixtures/bower.json');
39+
var deps = Object.keys(bowerJson.dependencies);
40+
deps = deps.concat(Object.keys(bowerJson.devDependencies));
41+
deps = deps.map(function(dep) {
42+
return path.join(__dirname, 'fixtures', 'bower_components', dep);
43+
});
44+
assert.file(deps);
45+
});
46+
});

0 commit comments

Comments
 (0)