@testdeck/di-typedi
TypeScript icon, indicating that this package has built-in type declarations

0.3.3 • Public • Published

Get it on NPM License Build Status Coverage Quality Gate Status Issues Pull Requests

@testdeck/di-typedi

Integration of the TypeDI IOC.

import { suite, test } from "@testdeck/mocha";
import { expect } from "chai";

// register TypeDI support with testdeck and also let reflect-metadata do it's magic
import "@testdeck/di-typedi";
import "reflect-metadata";

import { Service } from "typedi";

@Service()
class SomeService {

  doSomething(): boolean {

    return false;
  }
}

@suite
class Hello {

  constructor(private service: SomeService) {
  }

  @test
  world() {
    expect(this.service.doSomething()).to.be.true;
  }
}

This also works with the provided integrations for Jasmine and Jest.

If you are looking for other test framework support, please see the following packages

Installation

npm install --save-dev typedi reflect-metadata @testdeck/di-typedi

Additional Information

You can find a lot more information in the official documentation.

Read more about TypeDI.

Readme

Keywords

none

Package Sidebar

Install

npm i @testdeck/di-typedi

Weekly Downloads

355

Version

0.3.3

License

Apache-2.0

Unpacked Size

15.9 kB

Total Files

5

Last publish

Collaborators

  • pana-cc
  • silkentrance