Comments (4)
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.
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.
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.
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)
- Make headers configurable HOT 1
- Provide demo app HOT 2
- Grunt multimocks task should clear destination file/folder before writing HOT 1
- A console error should be raised when a scenario is not found HOT 2
- grunt workflow:dev should open the demo app HOT 3
- Tests for Grunt task
- Easily disable API delayed responses HOT 3
- Provide an out of the box directive that lists multimock scenarios inc links
- Make multimocks work with lodash v3 HOT 4
- Move the Scenario menu component into tempo-scenario HOT 2
- Gulp File HOT 2
- passThrough option HOT 7
- responseDelay only seems to have effect on successful mocked requests HOT 2
- Provide gulp task for multimocks HOT 1
- 0.6.8 HOT 6
- Grunt task should take config option to enable HAL-specific functionality HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-multimocks.