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

No line number provided in Windows on failed tests (and proposed fix) #220

Closed
AlexDM0 opened this issue Dec 9, 2015 · 2 comments
Closed

Comments

@AlexDM0
Copy link

AlexDM0 commented Dec 9, 2015

Hi,

When I'm using windows with nodejs, tape does not provide an at: field with the line numbers if a test fails.

It is fixed by placing:

var windowsPath = dir.substr(1,1) === ":"; // check for windows path if the second letter is a :
if (windowsPath)
  dir = dir.replace(/(\\)/g,"/").substr(2);  // swap \ for / and remove the D: or C: from C:\

at https://github.com/substack/tape/blob/master/lib/test.js#L212

and inserting:

if (windowsPath) 
  err[i] = err[i].replace(/(\\)/g,"/");  // swap \ for / 

before https://github.com/substack/tape/blob/master/lib/test.js#L214

This bug is caused by the drive letter before the path which you do not seem to expect in the rest of the logic and the inverted slashes.

I can do a pull if you'd like?

Regards

@AlexDM0 AlexDM0 changed the title No line number provided in Windows on failed tests No line number provided in Windows on failed tests (and proposed fix) Dec 9, 2015
hgwood pushed a commit to hgwood/tape that referenced this issue Jul 12, 2016
hgwood pushed a commit to hgwood/tape that referenced this issue Jul 12, 2016
Supersede tape-testing#221. Fix tape-testing#220. Generally makes tape support more kinds of
stacktrace formats.
hgwood pushed a commit to hgwood/tape that referenced this issue Jul 12, 2016
Supersede tape-testing#221. Fix tape-testing#220. Generally makes tape support more kinds of stacktrace formats.
hgwood pushed a commit to hgwood/tape that referenced this issue Jul 12, 2016
Supersede tape-testing#221. Fix tape-testing#220. Generally makes tape support more kinds of stacktrace formats.
hgwood pushed a commit to hgwood/tape that referenced this issue Jul 12, 2016
Supersede tape-testing#221. Fix tape-testing#220. Generally makes tape support more kinds of stacktrace formats.
hgwood pushed a commit to hgwood/tape that referenced this issue Jul 12, 2016
Supersede tape-testing#221. Fix tape-testing#220. Generally makes tape support more kinds of stacktrace formats.
@ljharb
Copy link
Collaborator

ljharb commented Sep 6, 2016

@AlexDM0 Given #316, is this issue resolved?

@AlexDM0
Copy link
Author

AlexDM0 commented Sep 7, 2016

I think it can be closed, thanks!

@AlexDM0 AlexDM0 closed this as completed Sep 7, 2016
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

2 participants