Skip to content
Permalink
Browse files

fix: support relative path (#95)

  • Loading branch information
atian25 authored and popomore committed Apr 1, 2018
1 parent f81f09b commit 7531faaae98e126ec0151721a5fbf7a73b6246b3
Showing with 11 additions and 1 deletion.
  1. +2 −1 lib/command.js
  2. +9 −0 test/ts.test.js
@@ -34,7 +34,8 @@ class Command extends BaseCommand {
argv.$0 = undefined;

// read `egg.typescript` from package.json
const baseDir = argv._[0] || argv.baseDir || cwd;
let baseDir = argv._[0] || argv.baseDir || cwd;
if (!path.isAbsolute(baseDir)) baseDir = path.join(cwd, baseDir);
const pkgFile = path.join(baseDir, 'package.json');
if (fs.existsSync(pkgFile)) {
const pkgInfo = require(pkgFile);
@@ -90,6 +90,15 @@ describe('test/ts.test.js', () => {
.end();
});

it('should start app with relative path', () => {
return coffee.fork(eggBin, [ 'dev', './example-ts-pkg' ], { cwd: path.dirname(cwd) })
// .debug()
.expect('stdout', /hi, egg, 12345/)
.expect('stdout', /started/)
.expect('code', 0)
.end();
});

it('should test app', () => {
return coffee.fork(eggBin, [ 'test' ], { cwd })
// .debug()

0 comments on commit 7531faa

Please sign in to comment.
You can’t perform that action at this time.