Skip to content

Commit d5cf0e1

Browse files
author
Mehdy Dara
committed
Merge pull request #110 from eleven-labs/improve-test
Improved test on the generated files
2 parents 7d6a8ba + 8db5e44 commit d5cf0e1

17 files changed

+878
-79
lines changed

.coveralls.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
repo_token: 80AGmTLC53q6aLmiJaUX4Sa3vkl8jVUbg

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
node_modules/
2-
temp/
2+
tempGulpAngular/
3+
coverage/
34
.DS_Store
45
npm-debug.log

.travis.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
language: node_js
2+
23
node_js:
34
- '0.10'
5+
46
before_install:
57
- npm install -g npm@latest
68
- npm install -g bower
79
- npm install -g gulp
10+
- npm install -g istanbul
11+
12+
after_script:
13+
- npm run coveralls

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,38 @@ yo gulp-angular [app-name]
6060

6161
[Best Practice Recommendations for Angular App Structure](https://docs.google.com/document/d/1XXMvReO8-Awi1EZXAXS4PzDzdNvV6pGcuaF4Q9821Es/pub)
6262

63+
The root directory generated for a app with name `gulpAngular` :
64+
<pre>
65+
├── src/
66+
│ ├── app/
67+
│ │ ├── main/
68+
│ │ │ ├── main.controller.js
69+
│ │ │ └── main.html
70+
│ │ └── index.js
71+
│ │ └── index.(css|less|scss)
72+
│ │ └── vendor.(css|less|scss)
73+
│ ├── assets/
74+
│ │ └── images/
75+
│ ├── components/
76+
│ │ └── navbar/
77+
│ │ │ ├── navbar.controller.js
78+
│ │ │ └── navbar.html
79+
│ ├── 404.html
80+
│ ├── favico.ico
81+
│ └── index.html
82+
├── gulp/
83+
├── test/
84+
├── bower_components/
85+
├── nodes_modules/
86+
├── .bowerrc
87+
├── .editorconfig
88+
├── .gitignore
89+
├── .jshintrc
90+
├── bower.json
91+
├── gulpfile.js
92+
├── package.json
93+
</pre>
94+
6395
## Features included in the gulpfile
6496
* *useref* : allow configuration of your files in comments of your HTML file
6597
* *ngAnnotate* : convert simple injection to complete syntax to be minification proof

app/files.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"test/e2e"
1111
],
1212
"copies": [
13+
"gulpfile.js",
1314
"gulp/e2e-tests.js",
1415
"gulp/server.js",
1516
"gulp/proxy.js",
@@ -24,7 +25,6 @@
2425
"templates": [
2526
"package.json",
2627
"bower.json",
27-
"gulpfile.js",
2828
"gulp/build.js",
2929
"gulp/watch.js",
3030
"gulp/wiredep.js",

app/index.js

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,24 @@ var chalk = require('chalk');
88
var prompts = require('./prompts.json');
99

1010
var GulpAngularGenerator = yeoman.generators.Base.extend({
11-
/* Initialization, evaluate appname */
12-
init: function () {
13-
this.pkg = require('../package.json');
1411

15-
this.argument('appname', { type: String, required: false });
12+
init: function () {
13+
// Define the appname
14+
this.argument('appname', {
15+
type: String,
16+
required: false
17+
});
1618
this.appname = this.appname || path.basename(process.cwd());
1719
this.appname = this._.camelize(this._.slugify(this._.humanize(this.appname)));
1820
},
1921

2022
info: function () {
21-
this.log(yosay(
22-
chalk.red('Welcome!') + '\n' +
23-
chalk.yellow('You\'re using the fantastic generator for scaffolding an application with Angular and Gulp!')
24-
));
23+
if (!this.options['skip-welcome-message']) {
24+
this.log(yosay(
25+
chalk.red('Welcome!') + '\n' +
26+
chalk.yellow('You\'re using the fantastic generator for scaffolding an application with Angular and Gulp!')
27+
));
28+
}
2529
},
2630

2731
checkYoRc: function() {
@@ -78,7 +82,8 @@ var GulpAngularGenerator = yeoman.generators.Base.extend({
7882
/* Install dependencies */
7983
install: function () {
8084
this.installDependencies({
81-
skipInstall: this.options['skip-install']
85+
skipInstall: this.options['skip-install'],
86+
skipMessage: this.options['skip-message']
8287
});
8388
}
8489
});

app/src/compile.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ module.exports = function () {
1616
return module.module;
1717
});
1818

19-
if(this.props.ui.key === 'bootstrap' &&
20-
this.props.cssPreprocessor.extension !== 'scss') {
19+
if(this.props.ui.key === 'bootstrap' && this.props.cssPreprocessor.extension !== 'scss') {
2120
this.props.ui.name = 'bootstrap';
2221
}
2322

File renamed without changes.

package.json

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,13 @@
1616
"repository": "Swiip/generator-gulp-angular",
1717
"scripts": {
1818
"pretest": "cd test/deps && npm install && bower install",
19-
"test": "mocha -g protractor -i"
19+
"test": "mocha -g protractor -i",
20+
"coveralls": "istanbul cover ./node_modules/mocha/bin/_mocha -- -g protractor -i && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
21+
"cover": "istanbul cover ./node_modules/mocha/bin/_mocha -- ./test/*.js"
2022
},
2123
"dependencies": {
2224
"async": "~0.8.0",
2325
"chalk": "~0.4.0",
24-
"lodash": "~2.4.1",
2526
"q": "~1.0.1",
2627
"yeoman-generator": "~0.17.0",
2728
"yosay": "^0.3.0"
@@ -31,9 +32,15 @@
3132
"chai": "~1.9.1",
3233
"chai-as-promised": "~4.1.1",
3334
"colors": "~0.6.2",
35+
"coveralls": "~2.11.0",
36+
"cross-spawn": "~0.2.3",
37+
"fixture-stdout": "^0.2.1",
3438
"gulp-less": "^1.3.3",
3539
"gulp-sass": "^0.7.3",
36-
"mocha": "~1.21.0"
40+
"istanbul": "~0.3.0",
41+
"lodash": "~2.4.1",
42+
"mocha": "~1.21.0",
43+
"mocha-lcov-reporter": "0.0.1"
3744
},
3845
"peerDependencies": {
3946
"yo": ">=1.0.0"

test/deps/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
"require-dir": "^0.1.0",
3434
"browser-sync": "^1.3.6",
3535
"http-proxy": "^1.3.0",
36-
"protractor": "^1.1.1",
36+
"chalk": "^0.4.0",
37+
"protractor": "^1.4.0",
3738
"uglify-save-license": "^0.4.1",
3839

3940
"gulp-less": "^1.3.3",

0 commit comments

Comments
 (0)