Skip to content

Commit

Permalink
fix: ets not found (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
whxaxes authored Mar 6, 2019
1 parent bef01de commit 8f6135e
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ test/fixtures/example-ts-ets/typings/
*.log
package-lock.json
.nyc_output
yarn.lock
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ language: node_js
node_js:
- '6'
- '8'
- '10'
env:
- EGG_VERSION=1
- EGG_VERSION=2
Expand Down
1 change: 1 addition & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
environment:
matrix:
- nodejs_version: '8'
- nodejs_version: '10'

install:
- ps: Install-Product node $env:nodejs_version
Expand Down
5 changes: 5 additions & 0 deletions bin/ets.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env node

'use strict';

require('egg-ts-helper/dist/bin');
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"main": "index.js",
"bin": {
"egg-bin": "bin/egg-bin.js",
"mocha": "bin/mocha.js"
"mocha": "bin/mocha.js",
"ets": "bin/ets.js"
},
"dependencies": {
"autod": "^3.0.1",
Expand Down
29 changes: 29 additions & 0 deletions test/ets-bin.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
'use strict';

const path = require('path');
const coffee = require('coffee');
const semver = require('semver');

describe('test/ets-bin.test.js', () => {
const etsBin = require.resolve('../bin/ets.js');
const cwd = path.join(__dirname, 'fixtures/example-ts-ets');

it('should test with ets', () => {
const higherVersion = semver.gte(process.version, '8.0.0');
if (!higherVersion) {
// skip 6.x, egg-ts-helper only works in >=8.0.0
return;
}

return coffee.fork(etsBin, [], {
cwd,
env: Object.assign({}, process.env, {
ETS_SILENT: 'false',
}),
})
// .debug()
.expect('stdout', /\[egg-ts-helper\] create/)
.expect('code', 0)
.end();
});
});

0 comments on commit 8f6135e

Please sign in to comment.