diff --git a/test/types/actions.ts b/test/types/actions.ts index d139143f12..2a604151a8 100644 --- a/test/types/actions.ts +++ b/test/types/actions.ts @@ -25,7 +25,7 @@ const required1: Action = (node, param) => { return { update: (p) => p === true, destroy: () => {} - } + }; }; required1; @@ -41,7 +41,7 @@ const required3: Action = (node, param) => { // @ts-expect-error comparison always resolves to false update: (p) => p === 'd', destroy: () => {} - } + }; }; required3; @@ -60,7 +60,7 @@ const optional1: Action = (node, param?) => { return { update: (p) => p === true, destroy: () => {} - } + }; }; optional1; @@ -82,7 +82,7 @@ const optional4: Action = (node, param?) => { // @ts-expect-error comparison always resolves to false update: (p) => p === 'd', destroy: () => {} - } + }; }; optional4; @@ -99,28 +99,31 @@ const no1: Action = (node) => { node; return { destroy: () => {} - } + }; }; no1; // @ts-expect-error param given -const no2: Action = (node, param?) => {} +const no2: Action = (node, param?) => {}; +no2; // @ts-expect-error param given -const no3: Action = (node, param) => {} +const no3: Action = (node, param) => {}; +no3; // @ts-expect-error update method given const no4: Action = (node) => { return { update: () => {}, destroy: () => {} - } -} + }; +}; +no4; // ---------------- ActionReturn const requiredReturn: ActionReturn = { - update: (p) => p.toString(), + update: (p) => p.toString() }; requiredReturn; @@ -129,13 +132,13 @@ const optionalReturn: ActionReturn = { p === true; // @ts-expect-error could be undefined p.toString(); - }, + } }; optionalReturn; const invalidProperty: ActionReturn = { // @ts-expect-error invalid property - invalid: () => {}, + invalid: () => {} }; invalidProperty; @@ -144,5 +147,7 @@ const attributes: Attributes = { a: 'a' }; attributes; // @ts-expect-error wrong type const invalidAttributes1: Attributes = { a: 1 }; +invalidAttributes1; // @ts-expect-error missing prop const invalidAttributes2: Attributes = {}; +invalidAttributes2;