Code Monkey home page Code Monkey logo

Comments (2)

kettanaito avatar kettanaito commented on September 26, 2024

Hi, @lavoscore. Thanks for reporting this.

There's no difference between these two snippets:

worker.use(a)
worker.use(b)
worker.use(a, b)

It's prepending values to an array:

msw/src/core/SetupApi.ts

Lines 26 to 28 in 7cf34c1

public prepend(runtimeHandles: Array<RequestHandler>): void {
this.handlers.unshift(...runtimeHandles)
}

I've added regression tests for your use case and they are passing for worker.use() and server.use():

#2145

Could you please take a look at those tests and see if you can spot any difference compared to what you are doing? If the issue still persists for you, please provide a reproduction repository where I can see it. Thanks.

from msw.

kettanaito avatar kettanaito commented on September 26, 2024

Released: v2.3.1 🎉

This has been released in v2.3.1!

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.

from msw.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.