Skip to content

Triple-slash reference affects all files instead of just the one file that contains it. #19978

Closed
@qz2017

Description

@qz2017

TypeScript Version: 2.4.2

Code

/// <reference types="mocha" />

Expected behavior:
Types from mocha are only available to the test ts file that include this triple-slash reference.

Actual behavior:
Types from mocha are available to all the ts files in the project, including both prod code and test code.
This is unexpected. How do we prevent Mocha test types from accidentally getting into prod code?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Working as IntendedThe behavior described is the intended behavior; this is not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions