Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
89 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
'use strict'; | ||
|
||
const path = require('path'); | ||
const coffee = require('coffee'); | ||
const mm = require('mm'); | ||
|
||
describe('test/es-module-bin.test.js', () => { | ||
afterEach(mm.restore); | ||
|
||
const myBin = require.resolve('./fixtures/es-module-bin/bin/es-module-bin.js'); | ||
const cwd = path.join(__dirname, 'fixtures/test-files'); | ||
|
||
it('es-module-bin --help', () => { | ||
return coffee.fork(myBin, [ '--help' ], { cwd }) | ||
.debug() | ||
.expect('stdout', /Options:/) | ||
.expect('stdout', /-h, --help.*/) | ||
.expect('code', 0) | ||
.end(); | ||
}); | ||
|
||
it('es-module-bin start', done => { | ||
coffee.fork(myBin, [ 'start' ], { cwd }) | ||
.debug() | ||
// .coverage(false) | ||
.expect('stdout', /override start command/) | ||
.expect('code', 0) | ||
.end(done); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env node | ||
|
||
'use strict'; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
const __1 = require('..'); | ||
new __1.default().start(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
const Command = require('../../../..'); | ||
|
||
class StartCommand extends Command { | ||
|
||
* run() { | ||
console.log('override start command'); | ||
} | ||
|
||
get description() { | ||
return 'start app override'; | ||
} | ||
} | ||
|
||
exports.default = StartCommand; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
'use strict'; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
const Command = require('../../..'); | ||
const path = require('path'); | ||
|
||
class MainCommand extends Command { | ||
constructor(rawArgv) { | ||
super(rawArgv); | ||
this.yargs.usage('Usage: es-module <command> [options]'); | ||
// load directory | ||
this.load(path.join(__dirname, 'command')); | ||
} | ||
} | ||
|
||
exports.default = MainCommand; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"name": "es-module-bin", | ||
"version": "3.0.0", | ||
"bin": { | ||
"es-module-bin": "bin/es-module-bin.js" | ||
} | ||
} |