Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

unit-test-ts-ioc-container

1.4.1 • Public • Published

npm bundle size

UnitTest TS IoContainer

Advantages

  • simple (it's just decorator for IServiceLocator from ts-ioc-container)
  • clean API
  • flexible (you can use any mocking engine just need to implement IMockAdapter)
  • auto-mocking
  • provides MoqAdapter to support moq.ts
import {Mock} from 'moq.ts';
import {ServiceLocatorFactory} from 'ts-ioc-container';
import {UnitTestServiceLocatorFactory, MoqAdapter, MoqAdapter} from 'unit-test-ts-ioc-container';
 
const container = new ServiceLocatorFactory().createIoCLocator();
const mockFactory = () => new MoqAdapter(new Mock());
const unitTestContainer = new UnitTestServiceLocatorFactory(mockFactory).create(container);
 
const stickerMock = unitTestContainer.resolveMock('ISticker');
stickerMock.setup(i => i.title).return('Sticker title');

Install

npm i unit-test-ts-ioc-container

DownloadsWeekly Downloads

51

Version

1.4.1

License

ISC

Unpacked Size

32.9 kB

Total Files

62

Last publish

Collaborators

  • avatar