Comments (12)
@jaredhasnon, has there been any progress on this? Given that simplicity of testing is one of the main benefits of IoC-enabled applications, I'd expect that'd be one of the first examples on the page.
from electrolyte.
I'll take a pull request for this, but writing extensive example code is not a priority for me personally.
from electrolyte.
+1 to this feature. API method to replace a single module in container would be enough.
from electrolyte.
+1 to this feature
from electrolyte.
+1
from electrolyte.
+1
I've created a RequireBin for my solution: http://requirebin.com/?gist=5f1c8f5855a69aa3edc0 .
It's not pretty but it works well for isolated example. In live project though it needed to execute _loadModule
method after replacing the dependency.
I would love to see some method to replace method in container. Also, it would be nice to have a section on the topic in readme.
from electrolyte.
+1
from electrolyte.
hey, created a pull request (#16) for a simple mocking extension to the Container class
usage:
ioc.mock( 'real/component', 'mock/component' );
from electrolyte.
+1 on this. My tests looks like:
var ioc = require('electrolyte');
var
common = ioc.create('commonfuncts'),
config = ioc.create('config')
app = ioc.create('app');
// actual test code
common.testMyApp(app, config);
There are ways to shorten this boilerplate?
from electrolyte.
+1
from electrolyte.
@jaredhanson you suggest that a PR will be accepted. As one exists, is there an ETA on when it will be merged?
from electrolyte.
+1
from electrolyte.
Related Issues (20)
- Implicit factory resolution HOT 2
- change default as singleton = true HOT 1
- change default as singleton = true HOT 3
- Better error handling on requiring component HOT 2
- Babel transpile with babel-preset-es2015 + async function breaks Electrolyte
- Electrolyte 0.4.0 should reject promise if a dependency is not found HOT 1
- Feature: Override existing Modules
- Release 0.4.0 - IoC.create now returns promise, createAsync doesn't exist HOT 4
- Failure to uphold semver expectations HOT 3
- version 0.3.0 returns objects while 0.4.0 returns promises HOT 11
- Child container
- support for es6 module syntax HOT 5
- Run example in repository : .get() requires callback functions but got a [object Object] Error: .get() requires callback functions but got a [object Object] HOT 5
- Unable to create object "XXXX" required by: unknown HOT 1
- Using it with class HOT 2
- Webpack? HOT 1
- Fix insecure dependencies
- Does IoC.use have to return a function? HOT 1
- Using custom resolvers to substitute components for testing and other purposes
- Is this repo being actively maintained HOT 1
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 electrolyte.