Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[question] mocha integration on the class level #1104

Closed
akosyakov opened this issue Jul 6, 2019 · 0 comments
Closed

[question] mocha integration on the class level #1104

akosyakov opened this issue Jul 6, 2019 · 0 comments

Comments

@akosyakov
Copy link

akosyakov commented Jul 6, 2019

I want to inject instances in mocha tests without passing the container, basically looking for something like:

import * as assert from 'assert';
import { inject, injectable } from 'inversify';
import { ApplicationShell } from './application-shell';
import { FrontendApplicationStateService } from '../frontend-application-state';

@suite
@injectable()
export class ApplicationShellTest {

    @inject(ApplicationShell)
    protected readonly shell: ApplicationShell;

    @test
    @timeout(4000)
    async testAttached(): Promise<void> {
        assert.ok(this.shell.isAttached);
    }

}

Maybe in the combination with https://www.npmjs.com/package/mocha-typescript

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

2 participants