Code Monkey home page Code Monkey logo

Comments (5)

mikicho avatar mikicho commented on May 20, 2024
  • What about testing against real envs with the same suite? IMO the tests should be able to mingle between envs easily. (also for CI/CD)
  • In the case your service is behind a3rd party gateway service, you can mock the header.

from nodejs-integration-tests-best-practices.

goldbergyoni avatar goldbergyoni commented on May 20, 2024

What about testing against real envs with the same suite? IMO the tests should be able to mingle between envs easily. (also for CI/CD)

That's a great feature 🔥🚀 which is not necessarily related to auth. I guess it's feasible for some of the tests (black-box tests) as those who are utilizing test doubles or alter the config (grey-box tests) won't be able to run against remote env. How can we separate between the two? Probably need to tag the black-box tests + make the URL inference dynamic, not always work against localhost rather make this configurable. I would also add this to our features list in the home page.

In the case your service is behind a3rd party gateway service, you can mock the header.

Not sure I followed, could you clarify?

from nodejs-integration-tests-best-practices.

mikicho avatar mikicho commented on May 20, 2024

@goldbergyoni For example, if you use Apigee, the authorization step happens before the request get to the service, so you can just send a mocked Authorization header

from nodejs-integration-tests-best-practices.

goldbergyoni avatar goldbergyoni commented on May 20, 2024

@mikicho What is a mocked auth header? I guess you refer to API gateways which accept a valid token

I'm asking to ensure I don't miss a bit

from nodejs-integration-tests-best-practices.

mikicho avatar mikicho commented on May 20, 2024

@goldbergyoni mocked auth header is jwt for example. If you sever doesn't verify it (because this is happening before the request hit your sever) you can send whatever value you want

from nodejs-integration-tests-best-practices.

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.