-
Notifications
You must be signed in to change notification settings - Fork 26
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
Windows: fakeload fails to match due to case differences in path #83
Comments
It definitely seems like someone should set up a proper development environment in Windows to try to ensure quibble works properly. I take this to mean you're using Windows command prompt and not the Windows Subsystem for Linux? |
Yes, Windows command prompt ( |
|
Quick update... I cloned the repo and tried running via the
I'm not sure if I did those conversions correctly and I guess I didn't get very far... or I may already have run into Windows-specific problems. Output from first command:
Output from second command:
I've seen that one before while digging either into this quibble issue or one I noticed in in testdouble (don't remember exactly). But this is clearly a platform-specific issue, as Windows paths start with a drive letter with a colon, and some URL logic inside quibble interprets those absolute file paths as URLs with a protocol prefix. Haven't had time yet to investigate more. And output from third command:
0 tests passed? Doesn't look right... Anyway, if I have some more time, I'll put this into Docker Desktop to see what the expected output should be from the original |
It will definitely be a non-trivial amount of work to make sure quibble works correctly under the win32 command prompt. It would be good to have, but I'm not sure whether it'll be worth the time investment. I'm curious how many developers using Windows and writing Node apps are running them are using Windows Subsystem for Linux (WSL); in my experience over the last few years, it seemed like adoption was immediate and extremely high, given how broken so many tools are in Node.js under Windows |
In the past all my personal NodeJS development as well as that of the teams I worked with was always on Windows. Don't know why but I never had to question yet whether that was the best way to do it or not. Speaking of quibble specifically, I agree that it looks like a lot of work to make everything run under Windows. I may have some more time to look into this later. Right now my family is expecting me to complete some home automation project first ;-) |
@cwienands1 There have been some recent patches for Windows support. You may want to try again with the latest version. |
I discovered this issue in Quibble 0.6.14 on my Windows developer machine.
I wrote a test case that is supposed to fake an inner dependency, like this:
When
logic
executes, it does not use a fake/stub but the real implementation. I tracked the problem down to the following...The
require("./login-with-aws")
call fromlogic.js
eventually reaches thefakeload()
method inquibble.js
. After thequibble.absolutify()
call, the path looks like this:C:\\Home\\my-project\\src\\logic.js
Note the upper-case drive and folder names.
Inside
stubbingThatMatchesRequest()
, thestubbedPath
variable starts with a lower-case drive letter, though, likec:\\Home\\my-project\\src\\login-with-aws.js
, and therefore the fake/stub lookup fails. A quick fix for this problem looks like this......but 1) this is ugly and probably the
quibbles
keys should already be added in lower-case format, 2) my quick and dirty fix could result in issues on Linux, which has a case-sensitive file system, and 3) there are probably more platform (Windows) specific issues in quibble, as I came across some strange behavior of testdouble, too.The text was updated successfully, but these errors were encountered: