Skip to content
Permalink
Browse files

fix: ets not found (#124)

  • Loading branch information
whxaxes committed Mar 6, 2019
1 parent bef01de commit 8f6135edf46584f009633fa82436ed16037f6cc5
Showing with 39 additions and 1 deletion.
  1. +1 −0 .gitignore
  2. +1 −0 .travis.yml
  3. +1 −0 appveyor.yml
  4. +5 −0 bin/ets.js
  5. +2 −1 package.json
  6. +29 −0 test/ets-bin.test.js
@@ -24,3 +24,4 @@ test/fixtures/example-ts-ets/typings/
*.log
package-lock.json
.nyc_output
yarn.lock
@@ -3,6 +3,7 @@ language: node_js
node_js:
- '6'
- '8'
- '10'
env:
- EGG_VERSION=1
- EGG_VERSION=2
@@ -1,6 +1,7 @@
environment:
matrix:
- nodejs_version: '8'
- nodejs_version: '10'

install:
- ps: Install-Product node $env:nodejs_version
@@ -0,0 +1,5 @@
#!/usr/bin/env node

'use strict';

require('egg-ts-helper/dist/bin');
@@ -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",
@@ -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.
You can’t perform that action at this time.