Open saverchenkov opened 9 years ago
I'll take a pull request for this, but writing extensive example code is not a priority for me personally.
+1 to this feature. API method to replace a single module in container would be enough.
+1 to this feature
+1
+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.
+1
hey, created a pull request (https://github.com/jaredhanson/electrolyte/pull/16) for a simple mocking extension to the Container class
usage:
ioc.mock( 'real/component', 'mock/component' );
+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?
+1
@jaredhanson you suggest that a PR will be accepted. As one exists, is there an ETA on when it will be merged?
@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.
+1
I am trying to find a typical pattern of mocking dependencies using electrolyte. Some example tests would be helpful. Thank you!