question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unit tests fail on Windows because of path separator

See original GitHub issue

This is a Bug Report

Description

When running npm test on Windows, the unit tests fail like:

      + expected - actual

       {
         "filename": "last"
         "libraryTarget": "commonjs"
      -  "path": "testpath\\.webpack"
      +  "path": "testpath/.webpack"
       }

The failures happen in multiple tests, everywhere where paths are checked against their expectations.

Proposed solution

The expectations should be composed by using path.sep as path separator to keep the tests platform independent.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
HyperBraincommented, Jul 4, 2017

Sounds like a good idea. This would complement Travis (where we can run linux and osx tests) perfectly. I will take care of the Travis integration in the next days, and will do some experiments with AppVeyor too.

0reactions
HyperBraincommented, Aug 17, 2017

V3 merged

Read more comments on GitHub >

github_iconTop Results From Across the Web

Test works on local Windows machine but fails on Linux server
separator string is handy to concat into the path string in order to produce an OS independent file path. String inputFile = "."...
Read more >
Fix for Unit Test on Windows [#2911377] | Drupal.org
Problem The following Unit Test does not pass in Windows environment due to hardcoded use of directory separator.
Read more >
Avoiding Platform Depedent Code
Windows and Unix systems use different conventions for the file separator ("\" in Windows, ... Using System properties String pathSeparator = System.
Read more >
Customizing Code Coverage Analysis - Visual Studio (Windows)
By default, code coverage analyzes all solution assemblies that are loaded during unit tests. We recommend that you use this default behavior, ...
Read more >
LLVM Testing Infrastructure Guide — LLVM 15.0.0 documentation
The unit and regression tests are in the main “llvm”/ directory under the directories ... Tests containing Windows paths will fail on Linux...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found