proxyquire

🔮 Proxies nodejs require in order to allow overriding dependencies during testing. (by thlorenz)

Proxyquire Alternatives

Similar projects and alternatives to proxyquire

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a better proxyquire alternative or higher similarity.

proxyquire reviews and mentions

Posts with mentions or reviews of proxyquire. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2021-12-17.
  • Best practices for writing testable ES6 modules
    1 project | /r/learnjavascript | 8 Jun 2023
    Take a look at proxyquire: https://www.npmjs.com/package/proxyquire - they do some fancy magic to allow you to stub es module imports.
  • AWS Lambda Functions (Node.js) - Unit testing using Mocha and Chai
    3 projects | dev.to | 17 Dec 2021
    Now that we know how to call/execute a lambda function in our local. Let us learn about mocking the dependencies inside the lambda function. These dependencies can be any third-party libraries or DB call or even an API call. To override and mock these dependencies we can use proxyquire package.
  • Don't mock modules
    1 project | dev.to | 4 May 2021
    I have been wary of this from when it first came about with rewire and similar libraries. As time has gone on my opinion has only strengthened, and with jest actively embracing mocking modules, I feel like nobody has even bothered to make a counter argument.
  • Is this type of monkeypatching possible in js?
    1 project | /r/learnjavascript | 12 Mar 2021
    If you move foo to a different file and use something like proxyquire, you can override the require from that file to foo.js and sub in something else in the test.
  • A note from our sponsor - WorkOS
    workos.com | 23 Apr 2024
    The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning. Learn more →

Stats

Basic proxyquire repo stats
4
2,741
0.0
over 1 year ago

thlorenz/proxyquire is an open source project licensed under MIT License which is an OSI approved license.

The primary programming language of proxyquire is JavaScript.


Sponsored
Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com