4.0.11 • Published 3 years ago

unit-test-ts-ioc-container v4.0.11

Weekly downloads
6
License
ISC
Repository
github
Last release
3 years ago

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');
4.0.11

3 years ago

4.0.10

3 years ago

4.0.9

3 years ago

4.0.5

3 years ago

4.0.4

3 years ago

4.0.7

3 years ago

4.0.6

3 years ago

4.0.3

3 years ago

3.0.3

3 years ago

4.0.1

3 years ago

4.0.0

3 years ago

4.0.2

3 years ago

3.0.2

3 years ago

3.0.1

3 years ago

3.0.0

3 years ago

2.1.4

3 years ago

2.1.2

3 years ago

2.1.1

3 years ago

2.0.2

3 years ago

2.1.3

3 years ago

2.1.0

3 years ago

1.4.3

3 years ago

1.4.1

3 years ago

1.4.0

3 years ago

1.3.13

3 years ago

1.3.12

4 years ago

1.3.10

4 years ago

1.3.11

4 years ago

1.3.9

4 years ago

1.3.8

4 years ago

1.3.7

4 years ago

1.3.6

4 years ago

1.3.4

4 years ago

1.3.3

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago