How to use typescript-ioc - 10 common examples

To help you get started, we’ve selected a few typescript-ioc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TreeGateway / tree-gateway / src / spec / test-gateway.ts View on Github external
beforeAll(function(done){
        config = Container.get(Configuration);
		if (config.loaded) {
			startGateway()
				.then(done)
				.catch(err => {
					console.error(err);
					fail(err);
				});	
		} else {
			config.on("load", () => {
				startGateway()
					.then(done)
					.catch(err => {
						console.error(err);
						fail(err);
					});	
			});
github TreeGateway / tree-gateway / test / unit / throttling.spec.ts View on Github external
before(() => {
        config = Container.get(Configuration);
        gatewayRequest = request.defaults({ baseUrl: `http://localhost:${config.gateway.protocol.http.listenPort}` });
    });
github TreeGateway / tree-gateway / test / unit / circuitbreaker.spec.ts View on Github external
before(() => {
        config = Container.get(Configuration);
        gatewayRequest = request.defaults({baseUrl: `http://localhost:${config.gateway.protocol.http.listenPort}`});
    });
github TreeGateway / tree-gateway / test / unit / cache.spec.ts View on Github external
before(() => {
        config = Container.get(Configuration);
        gatewayRequest = request.defaults({baseUrl: `http://localhost:${config.gateway.protocol.http.listenPort}`});

    });
github TreeGateway / tree-gateway / test / unit / authenticator.spec.ts View on Github external
before(() => {
        config = Container.get(Configuration);
        gatewayRequest = request.defaults({ baseUrl: `http://localhost:${config.gateway.protocol.http.listenPort}` });

    });
github TreeGateway / tree-gateway / test / unit / cors.spec.ts View on Github external
before(() => {
        config = Container.get(Configuration);
        gatewayRequest = request.defaults({baseUrl: `http://localhost:${config.gateway.protocol.http.listenPort}`});

    });
github TreeGateway / tree-gateway / test / unit / install-apis.spec.ts View on Github external
async function startGateway() {
        database = Container.get(Database);
        gateway = Container.get(Gateway);
        await database.redisClient.flushdb();
        await gateway.start();
        await gateway.startAdmin();
        gateway.server.set('env', 'test');
        sdk = await SDK.initialize({
            defaultHost: getSwaggerHost(config.gateway),
            swaggerUrl: getSwaggerUrl(config.gateway),
            token: generateSecurityToken(config.gateway)
        });
    }
github TreeGateway / tree-gateway / test / unit / uninstall-apis.spec.ts View on Github external
before(async () => {
        config = Container.get(Configuration);
        database = Container.get(Database);
        gateway = Container.get(Gateway);

        sdk = await SDK.initialize({
            defaultHost: getSwaggerHost(config.gateway),
            swaggerUrl: getSwaggerUrl(config.gateway),
            token: generateSecurityToken(config.gateway)
        });
    });
github TreeGateway / tree-gateway / test / unit / gateway.spec.ts View on Github external
return new Promise((resolve, reject) => {
            const swaggerUrl = `http://localhost:${config.gateway.admin.protocol.http.listenPort}/${config.gateway.admin.apiDocs.path}/json`;
            database = Container.get(Database);
            gateway = Container.get(Gateway);
            gateway.start()
            .then(() => gateway.startAdmin())
            .then(() => {
                gateway.server.set('env', 'test');
                gatewayRequest = request.defaults({baseUrl: `http://localhost:${config.gateway.protocol.http.listenPort}`});

                return database.redisClient.flushdb();
            })
            .then(() => createUser())
            .then((user) => SDK.initialize(swaggerUrl, 'config', '123test'))
            .then((s) => {
                sdk = s;
                return installMiddlewares();
            })
            .then(() => installApis())
            .then(resolve)
github TreeGateway / tree-gateway / test / unit / gateway.spec.ts View on Github external
before(function(){
        config = Container.get(Configuration);
        if (config.loaded) {
            return startGateway();
        } else {
            return new Promise((resolve, reject) => {
                    config.on('load', () => {
                        startGateway()
                            .then(resolve)
                            .catch(reject);
                    });
            });
        }
    });

typescript-ioc

A Lightweight annotation-based dependency injection container for typescript.

MIT
Latest version published 5 years ago

Package Health Score

42 / 100
Full package analysis

Popular typescript-ioc functions