Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

Commit

Permalink
refactor: Remove need for legacy code tests
Browse files Browse the repository at this point in the history
  • Loading branch information
brettz9 committed Feb 11, 2022
1 parent 79e9112 commit bc07571
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions test-d/index.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import { expectType, expectAssignable, expectError } from 'tsd';

import { KEYS, getKeys, unionWith, VisitorKeys } from "../";

type VisitorKeysWritable = { [type: string]: ReadonlyArray<string> };

const assignmentExpression = {
type: "AssignmentExpression",
operator: "=",
Expand Down Expand Up @@ -39,29 +37,14 @@ expectType<{readonly [type: string]: readonly string[]}>(unionWith({
TestInterface2: ["expression"]
}));

const keys: {
[type: string]: readonly string[]
} = {
TestInterface1: ["left", "right"]
};

const readonlyKeys: {
readonly [type: string]: readonly string[]
} = {
TestInterface1: ["left", "right"]
};

expectAssignable<VisitorKeysWritable>(keys);

expectAssignable<VisitorKeys>(readonlyKeys);

expectError(() => {
const erring: VisitorKeysWritable = {
TestInterface1: ["left", "right"]
};
erring.TestInterface1 = "badType";
});

// https://github.com/SamVerschueren/tsd/issues/143
// expectError(() => {
// const erring: VisitorKeys = {
Expand Down

0 comments on commit bc07571

Please sign in to comment.