mswjs / msw

Industry standard API mocking for JavaScript.
https://mswjs.io
MIT License
15.97k stars 519 forks source link

Add cross platform path support to workerDirectory #2218

Closed Tornek closed 2 months ago

Tornek commented 4 months ago

Prerequisites

Environment check

Node.js version

20.15.1

Reproduction repository

-

Reproduction steps

To reproduce my problem you will need both a Mac and a Windows computer. You need to write path with slashes in msw.workerDirectory in package.json. For example:

package.json
{
  ...,
  "msw": {
    "workerDirectory": "public/sw"
  },
  ...
}

And run your application with msw

Current behavior

On windows we get this message

image

On Mac we have Service Worker successfully created!

Expected behavior

We have Service Worker successfully created! on each computers

nabby27 commented 3 months ago

Great project!

I'm gonna create a small bounty for this issue if you don't mind @kettanaito since I'll like to see this feature implemented

mobley-trent commented 2 months ago

I'd like to give this issue a go @kettanaito @nabby27

ivanfernandez2646 commented 2 months ago

@Tornek I think you use an old version of the library (for the message that you show). Despite of is a minor problem, I'll try to solve it :)))

Keep in contact!

ivanfernandez2646 commented 2 months ago

@nabby27 The bot here is not working, is it installed in the project??. I'm trying to start working on it...

nabby27 commented 2 months ago

@ivanfernandez2646 Exactly, the Opire bot is not installed in this project but you can solve it anyway and claim the reward in your dashboard with the PR

ivanfernandez2646 commented 2 months ago

@Tornek as I said in the last version it works correctly.

I test on Windows and MacOs computers...

Also I create a PR prove of that with some tescases that cover this.

Thanks!!

@kettanaito @nabby27

kettanaito commented 2 months ago

Released: v2.4.2 🎉

This has been released in v2.4.2!

Make sure to always update to the latest version (npm i msw@latest) to get the newest features and bug fixes.


Predictable release automation by @ossjs/release.