electron-userland / electron-userland/electron-webpack

Tests fail on windows

Open
#198 3 comments 0 reactions 0 assignees View on GitHub
help wanted
Dominant language
TypeScript
Stars
902
Forks
168
PR merge metrics
No merged PRs in 30d

Description

Several tests fail when executing them on a Windows system. It seems that local file paths do not get translated or processed correctly.

This is the summary for me after running `yarn test` on the freshly cloned and installed project:
```
Test Suites: 2 failed, 1 passed, 3 total
Tests: 6 failed, 6 passed, 12 total
Snapshots: 10 failed, 8 passed, 18 total
Time: 10.239s
Ran all test suites.
```

All failures seem to be related to file paths, similar to this one:
```
- [0] /node_modules/css-loader!./src/renderer/style.css {0} [built]
- [1] /node_modules/css-loader/lib/css-base.js 2.21 KiB {0} [built]"
+ [0] C:/Users/Jovica.Aleksic/Desktop/electron-webpack/node_modules/css-loader!./src/renderer/style.css {0} [built]
+ [1] C:/Users/Jovica.Aleksic/Desktop/electron-webpack/node_modules/css-loader/lib/css-base.js 2.21 KiB {0} [built]"
```

Some are failing due to mismatch in file size, but that might be just a consequence of generated files containing the longer local file paths in several occasions, e.g.:

```
- styles.css 135 bytes 0 [emitted] renderer
+ styles.css 141 bytes 0 [emitted] renderer
```

Would be great if somebody could fix the test setup so that it works on any platform.
I chatted about this with @develar once, and he said I shouldn't worry much as a user, this is rather for the core developers only.
However, writing a reply to https://github.com/electron-userland/electron-webpack/issues/197 I realized how important it is to have working tests, especially for somebody who is new and wants to contribute.
In that case, having not-really-working tests is worse than having no tests at all, because as a somewhat experienced developer, you see there are tests and naturally the first thing you do is run the tests.

In my case when I first came to this project, I spent quite some time trying to figure out what's wrong and I even approached the main developer via Slack to ask.. Because I wasn't sure if I did something wrong during project setup.
So instead of actually contributing and developing, I was "wasting time", and this may happen to other users as well.

On the other hand, having the tests simply pass - well, they are green, give you a good feeling and motivation to start hacking, and I think.. it can just be expected for the tests to work out of the box.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.