@tractor/dependency-injection
@tractor/dependency-injection
npm i @tractor/dependency-injection
@tractor/dependency-injection

@tractor/dependency-injection

A UI around Protractor to help write E2E tests for Angular applications without needing to know JavaScript

by TradeMe

1.9.4-tractor-to-playwright.0 (see all)License:MITTypeScript:Not Found
npm i @tractor/dependency-injection
Readme

@tractor/dependency-injection

Dependency Injection container for tractor.

npm version

API

constant

Adds a constant reference to the container by name.

Usage

import { DI } from '@tractor/dependency-injection';

DI.constant({ config: { my: 'config' }});

factory

Adds a factory function to the container by name.

Usage

import { DI } from '@tractor/dependency-injection';

DI.factory(function myFunction () {});

call

calls a function with injected dependencies.

Usage

import { DI } from '@tractor/dependency-injection';

let config = {};
DI.constant({ config });

function init (config) {}
init['@Inject'] = ['config'];

DI.call(init);

instantiate

Creates a new instance of a factory with injected dependencies.

Usage

import { DI } from '@tractor/dependency-injection';

let config = {};
DI.constant({ config });

function Engine () {}
DI.factory(Engine);

function Tractor (config, engine) {
    this.config = config;
    this.engine = engine;
}
Tractor['@Inject'] = ['config', 'Engine'];
DI.factory(Tractor);

let tractor = DI.instantiate(Tractor);

Downloads/wk

43

GitHub Stars

26

LAST COMMIT

2yrs ago

MAINTAINERS

7

CONTRIBUTORS

18

OPEN ISSUES

8

OPEN PRs

8
VersionTagPublished
1.9.4-tractor-to-playwright.0
latest
1yr ago
1.9.6-alpha.0
next
2yrs ago
No alternatives found
No tutorials found
Add a tutorial
No dependencies found

Rate & Review

100
No reviews found
Be the first to rate