Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: cov replaced warning at win #49

Merged
merged 1 commit into from
Apr 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!--
Thank you for your pull request. Please review below requirements.
Bug fixes and new features should include tests and possibly benchmarks.
Contributors guide: https://github.com/eggjs/egg/blob/master/CONTRIBUTING.md
感谢您贡献代码。请确认下列 checklist 的完成情况。
Bug 修复和新功能必须包含测试,必要时请附上性能测试。
Contributors guide: https://github.com/eggjs/egg/blob/master/CONTRIBUTING.md
-->

##### Checklist
<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

- [ ] `npm test` passes
- [ ] tests and/or benchmarks are included
- [ ] documentation is changed or added
- [ ] commit message follows commit guidelines

##### Affected core subsystem(s)
<!-- Provide affected core subsystem(s). -->


##### Description of change
<!-- Provide a description of the change below this comment. -->
6 changes: 0 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ class EggBin extends Command {

// load directory
this.load(path.join(__dirname, 'lib/cmd'));

/* istanbul ignore if */
if (process.platform === 'win32') {
console.warn('`cov` is replaced with `test` at windows');
this.alias('cov', 'test');
}
}
}

Expand Down
6 changes: 6 additions & 0 deletions lib/cmd/cov.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ class CovCommand extends Command {
}

* run(context) {
/* istanbul ignore if */
if (process.platform === 'win32') {
console.warn('`cov` is replaced with `test` at windows');
return yield super.run(context);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里有个继承,真巧妙

}

const { cwd, argv, execArgv } = context;
const tmpDir = path.join(cwd, '.tmp');
yield mkdirp(tmpDir);
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,28 @@
"dependencies": {
"change-case": "^3.0.1",
"co-mocha": "^1.2.0",
"common-bin": "^2.2.0",
"debug": "^2.6.3",
"common-bin": "^2.3.0",
"debug": "^2.6.4",
"detect-port": "^1.1.1",
"egg-utils": "^2.1.0",
"globby": "^6.1.0",
"intelli-espower-loader": "^1.0.1",
"istanbul": "^1.1.0-alpha.1",
"mocha": "^3.2.0",
"mocha": "^3.3.0",
"mz-modules": "^1.0.0",
"power-assert": "^1.4.2",
"ypkgfiles": "^1.3.1"
"ypkgfiles": "^1.4.0"
},
"devDependencies": {
"autod": "^2.7.1",
"autod": "^2.8.0",
"babel": "^6.3.26",
"babel-preset-airbnb": "^1.0.1",
"babel-register": "^6.4.3",
"coffee": "^3.3.0",
"cross-env": "^3.1.3",
"egg-ci": "^1.5.0",
"egg-ci": "^1.6.0",
"enzyme": "^2.0.0",
"eslint": "^3.18.0",
"eslint": "^3.19.0",
"eslint-config-egg": "^3.2.0",
"jsdom": "^8.0.1",
"mm": "^2.1.0",
Expand Down
2 changes: 1 addition & 1 deletion test/lib/cmd/pkgfiles.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('test/lib/cmd/pkgfiles.test.js', () => {
yield fs.writeFile(path.join(cwd, 'package.json'), '{}');

yield coffee.fork(eggBin, [ 'pkgfiles', '--check' ], { cwd })
.debug()
// .debug()
.expect('stderr', /pkg.files should equal to \[ app, config, app.js ], but got \[ {2}]/)
.expect('code', 1)
.end();
Expand Down