Giter Club home page Giter Club logo

Comments (10)

novemberborn avatar novemberborn commented on June 13, 2024

@mysticatea does it crash if you run mocha --require babel-register test.js?

from nyc.

mysticatea avatar mysticatea commented on June 13, 2024

It does not crash.

> mocha --require babel-register test.js

[Function: Foo]


  0 passing (1ms)

from nyc.

novemberborn avatar novemberborn commented on June 13, 2024

Works for me with Node 4.2.1 and 5.0 on OS X, which makes me think this is a Windows issue. Is there anything interesting in the longer stack trace? There's repetition here:

    at requireHook (C:\Users\t-nagashima.AD\Documents\GitHub\sand\node_modules\nyc\index.js:139:7)
    at require.extensions.(anonymous function) (C:\Users\t-nagashima.AD\Documents\GitHub\sand\node_modules\babel-register\lib\node.js:138:7)
    at requireHook (C:\Users\t-nagashima.AD\Documents\GitHub\sand\node_modules\nyc\index.js:139:7)
    at require.extensions.(anonymous function) (C:\Users\t-nagashima.AD\Documents\GitHub\sand\node_modules\babel-register\lib\node.js:138:7)

but then it crashes on String.split?!

    at String.split (native)
    at Object.win32.resolve (path.js:174:46)
    at Object.win32.relative (path.js:259:16)
    at getRelativePath (C:\Users\t-nagashima.AD\Documents\GitHub\sand\node_modules\babel-register\lib\node.js:72:28)
    at shouldIgnore (C:\Users\t-nagashima.AD\Documents\GitHub\sand\node_modules\babel-register\lib\node.js:123:12)
    at require.extensions.(anonymous function) (C:\Users\t-nagashima.AD\Documents\GitHub\sand\node_modules\babel-register\lib\node.js:137:9)

@bcoe do you have access to a Windows box to confirm this on?

from nyc.

mysticatea avatar mysticatea commented on June 13, 2024
    at requireHook (C:\Users\t-nagashima.AD\Documents\GitHub\sand\node_modules\nyc\index.js:139:7)
    at require.extensions.(anonymous function) (C:\Users\t-nagashima.AD\Documents\GitHub\sand\node_modules\babel-register\lib\node.js:138:7)
    at requireHook (C:\Users\t-nagashima.AD\Documents\GitHub\sand\node_modules\nyc\index.js:139:7)
    at require.extensions.(anonymous function) (C:\Users\t-nagashima.AD\Documents\GitHub\sand\node_modules\babel-register\lib\node.js:138:7)

This is a stackoverflow, so there is possibility of clashing in every function call.

Hmm, Babel seems to call the old extension here, but the old extension is nyc and nyc is calling Babel. So looks there is a potential infinity loop.

filename is C:\Users\t-nagashima.AD\Documents\GitHub\sand\node_modules\mocha\bin\mocha so it's ignored.

from nyc.

bcoe avatar bcoe commented on June 13, 2024

@mysticatea could you give the current master branch a shot, there have been some changes to the require-hook that I think might fix the infinite you're seeing.

Disclaimer, I have yet to get subprocess spawning fully functional in Windows.

from nyc.

mysticatea avatar mysticatea commented on June 13, 2024

Ok, I will try it later.

from nyc.

bcoe avatar bcoe commented on June 13, 2024

@mysticatea I tested the master branch of nyc on Windows, and it worked great with a couple changes:

screen shot 2015-12-06 at 5 18 09 pm

  1. test.js is ignored by default, so you should change the filename to something like foo.js.
  2. nyc currently has trouble capturing exit events in windows, so rather than running mocha I ran the _mocha bin (which does not spawn a subprocess).

nyc --require babel-register node_modules/.bin/_mocha test.js

  1. by default the babel register hook will be called for each module in the node_modules folder, you should probably configure babel to ignore this folder.

from nyc.

mysticatea avatar mysticatea commented on June 13, 2024

Thank you for the verification and the information!
I also verified that master branch works.
I'm looking forward to the next release. :)

from nyc.

bcoe avatar bcoe commented on June 13, 2024

@mysticatea I've released [email protected] with these fixes for Windows, I've also patched Windows so that it works without needing to reference _mocha:

#87

Your original node_modules/.bin/mocha should work now.

from nyc.

mysticatea avatar mysticatea commented on June 13, 2024

Thank you so much!

from nyc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.