Giter Site home page Giter Site logo

Comments (4)

chrisiconolly avatar chrisiconolly commented on September 24, 2024

This makes a lot of sense - what should happen if fooScenario and barScenario contain conflicting resources?
eg: fooScenario contains quote/error.json and fooScenario contains quote/slowResponse.json

If we choose the pattern that resources declared later are used it also allows you to extend a single scenario and just overwrite files directly

"emptyShoppingCart": [
    "extends": [
       "fooScenario"
    ]
    "cart/noItems.json"
  ]

from angular-multimocks.

edconolly avatar edconolly commented on September 24, 2024

It still doesn't get around the problem, since I can still state quote/fastResponse.json in my actual resource definitions also. Do we need a build time check?

from angular-multimocks.

chrisiconolly avatar chrisiconolly commented on September 24, 2024

You can use the same logic, the last conflicting mock in the definition is the one that gets used. So anything you explicitly declare will be used as a priority. Be interesting to see what Nabil thinks.

This feature however might mean the config of laying out mocks might have to go through a braking change to something more like

"userWithCreditHasEmptyCart": {
    "extends": [
      "someItems",
      "userHasCredit"
    ],
    "mocks": [
      "cart/empty.json"
    ]
  }

from angular-multimocks.

nabil-boag avatar nabil-boag commented on September 24, 2024

I think this is a great feature request, and one that is the natural next step for mocking.

We should try to add this functionality without breaking backwards compatibility, but if we find an elegant solution that breaks backwards compatibility, we are still a small project so we should go for it. As @chrisiconolly said, this might be worth bumping the project up to v 1.0 for!

from angular-multimocks.

Related Issues (17)

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.