GithubHelp home page GithubHelp logo

Comments (12)

dkushner avatar dkushner commented on July 26, 2024 1

@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.

jaredhanson avatar jaredhanson commented on July 26, 2024

I'll take a pull request for this, but writing extensive example code is not a priority for me personally.

from electrolyte.

mikalai-sauchanka avatar mikalai-sauchanka commented on July 26, 2024

+1 to this feature. API method to replace a single module in container would be enough.

from electrolyte.

digitalwm avatar digitalwm commented on July 26, 2024

+1 to this feature

from electrolyte.

joeltello avatar joeltello commented on July 26, 2024

+1

from electrolyte.

pwlmaciejewski avatar pwlmaciejewski commented on July 26, 2024

+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.

charlires avatar charlires commented on July 26, 2024

+1

from electrolyte.

gimre avatar gimre commented on July 26, 2024

hey, created a pull request (#16) for a simple mocking extension to the Container class

usage:

ioc.mock( 'real/component', 'mock/component' );

from electrolyte.

colthreepv avatar colthreepv commented on July 26, 2024

+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.

cades avatar cades commented on July 26, 2024

+1

from electrolyte.

mattgi avatar mattgi commented on July 26, 2024

@jaredhanson you suggest that a PR will be accepted. As one exists, is there an ETA on when it will be merged?

from electrolyte.

BLaurent avatar BLaurent commented on July 26, 2024

+1

from electrolyte.

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.