EvanBurchard / wish

node assertion library without special syntax
42 stars 4 forks source link

When test fails, wish.js failing also #9

Closed iggirex closed 7 years ago

iggirex commented 7 years ago

Going through Evan's book "Refactoring JS" that's how I found wish. The first example of the book using wish isn't working. When tests pass I get no message in terminal, when tests fail I get this error message:

`C:\Users\iaguerrevere\Desktop\Refactoring JS>node check-hand.js C:\Users\iaguerrevere\Desktop\Refactoring JS\node_modules\wish\lib\wish.js:88 line.fileName = line.full.match(/(\/.*.js)/)[1]; ^

TypeError: Cannot read property '1' of null at createLineFromErrorObject (C:\Users\iaguerrevere\Desktop\Refactoring JS\node_modules\wish\lib\wish.js:88:52) at getExpression (C:\Users\iaguerrevere\Desktop\Refactoring JS\node_modules\wish\lib\wish.js:107:20) at handleFalseWish (C:\Users\iaguerrevere\Desktop\Refactoring JS\node_modules\wish\lib\wish.js:126:36) at wish (C:\Users\iaguerrevere\Desktop\Refactoring JS\node_modules\wish\lib\wish.js:143:15) at Object. (C:\Users\iaguerrevere\Desktop\Refactoring JS\check-hand.js:4:1) at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3)`

Ways I've tried to fix: uninstall wish, reinstall wish, update npm, tried the simplest test scenarios possible like wish(4==5), tried changing the file name, and I should mention the tests were working using node's assert. This error message seems to be the same no matter what the failing test is.

EvanBurchard commented 7 years ago

Hey @iggirex, can you try updating to wish 1.0.0?

iggirex commented 7 years ago

Hi @EvanBurchard, after an update, I didn't see anything happen in my terminal, but still got the same error. Then I installed wish again, I saw it install again and tell me it's at version 1.0.0. Still get the same error : /

I'm using Windows 10 and CMD, idk if that has anything to do with the issue...

EvanBurchard commented 7 years ago

@iggirex What's your version of node?

iggirex commented 7 years ago

@EvanBurchard Node version 6.11.0

EvanBurchard commented 7 years ago

Can you update to node 7.7.1?

iggirex commented 7 years ago

I just switched to Node 7.7.1 and still getting same error.

The program is just two lines of code at this point, pretty sure it's not the code: var wish = require("wish"); wish(4===5);

EvanBurchard commented 7 years ago

I'm at a loss. What does the stack trace look like if you have a file testing.js with this in it:

throw Error('');

And then run node testing.js

iggirex commented 7 years ago

idk why this isn't getting formatted to look like code, I have the backticks. But one thing getting screwed up is the up carrot should be pointing at "throw" where it says "throw Error('');"

`C:\Users\iaguerrevere\Desktop\Refactoring JS>node testing.js C:\Users\iaguerrevere\Desktop\Refactoring JS\testing.js:1 (function (exports, require, module, filename, dirname) { throw Error(''); ^

Error at Object. (C:\Users\iaguerrevere\Desktop\Refactoring JS\testing.js:1:69) at Module._compile (module.js:571:32) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:488:32) at tryModuleLoad (module.js:447:12) at Function.Module._load (module.js:439:3) at Module.runMain (module.js:605:10) at run (bootstrap_node.js:425:7) at startup (bootstrap_node.js:146:9) at bootstrap_node.js:540:3`

EvanBurchard commented 7 years ago

Can you try this?

git clone git@github.com:EvanBurchard/wish.git
cd wish
npm install
npm test
EvanBurchard commented 7 years ago

I'm going to close this out for now. I think it has to do with windows compatibility, which we can track over here.