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

Not catching readonly error #143

Closed
brettz9 opened this issue Feb 9, 2022 · 0 comments · Fixed by #177
Closed

Not catching readonly error #143

brettz9 opened this issue Feb 9, 2022 · 0 comments · Fixed by #177

Comments

@brettz9
Copy link

brettz9 commented Feb 9, 2022

I would expect the "only permits reading" error to be caught by the test framework and not reported when running tsd, but instead I get notified that no error was found and that I was assigning to an index signature only permitting reading:

export type KeysStrictReadonly = {
    readonly [type: string]: readonly string[];
};
import { expectError } from 'tsd';
import { KeysStrictReadonly } from "../lib/index.js";

expectError(() => {
    const erring: KeysStrictReadonly = {
        TestInterface1: ["left", "right"]
    };
    erring.TestInterface1 = ["badAttemptOverwrite"];
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant