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

TypesScript support on windows not working #522

Closed
fox1t opened this issue Mar 22, 2019 · 1 comment
Closed

TypesScript support on windows not working #522

fox1t opened this issue Mar 22, 2019 · 1 comment

Comments

@fox1t
Copy link
Contributor

fox1t commented Mar 22, 2019

Hi!
Testing TS code is not working at the moment. Current implementation uses ts-node bin field that is not cross-platform.
The right way to use ts-node cross-platform is to pass -r ts-node/register option to node, instead of spawning ts-node child process.

I'll make a PR to fix this specific issue.

This is the full error dump on Windows 10:

 TAP version 13
not ok 1 - ./index.ts # time=20.695ms
  ---
  timeout: 30000
  file: ./index.ts
  childId: 0
  command: >-
    C:\temp\node_modules\ts-node\dist\bin.js
  args:
    - '-r'
    - >-
      C:\temp\node_modules\esm\esm.js
    - ./index.ts
  stdio:
    - 0
    - pipe
    - 2
  cwd: 'C:\temp'
  ...
{

    not ok 1 - spawn UNKNOWN
      ---
      timeout: 30000
      file: ./index.ts
      childId: 0
      command: >-
        C:\temp\node_modules\ts-node\dist\bin.js
      args:
        - '-r'
        - >-
          C:\temp\node_modules\esm\esm.js
        - ./index.ts
      stack: |
        loop (node_modules/function-loop/index.js:35:15)
      stdio:
        - 0
        - pipe
        - 2
      cwd: 'C:\temp'
      at:
        line: 366
        column: 11
        file: internal/child_process.js
        function: ChildProcess.spawn
      errno: UNKNOWN
      code: UNKNOWN
      syscall: spawn
      test: ./index.ts
      ...
    1..1
    # failed 1 test
}

1..1
# failed 1 test
# time=44.501ms
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] test: `tap -J ./index.ts`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Baz\AppData\Roaming\npm-cache\_logs\2019-03-22T11_30_27_215Z-debug.log 
@fox1t
Copy link
Contributor Author

fox1t commented Mar 22, 2019

I opened 523 PR.

@isaacs isaacs closed this as completed in ad3bed4 Mar 22, 2019
isaacs pushed a commit that referenced this issue Mar 22, 2019
Fixes cross-plaftorm issues.

Close #523
Close #522

@isaacs: Ported to v13 by @isaacs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant