diff --git a/modules/store/spec/types/action_creator.spec.ts b/modules/store/spec/types/action_creator.spec.ts index 873777693c..4155d6f62e 100644 --- a/modules/store/spec/types/action_creator.spec.ts +++ b/modules/store/spec/types/action_creator.spec.ts @@ -39,7 +39,7 @@ describe('createAction()', () => { expectSnippet(` const foo = createAction('FOO', props<{ type: number }>()); `).toFail( - /Argument of type '"type property is not allowed in action creators"' is not assignable to parameter of type/ + / Type 'Props<\{ type: number; \}>' is not assignable to type '"type property is not allowed in action creators"'/ ); }); @@ -47,7 +47,7 @@ describe('createAction()', () => { expectSnippet(` const foo = createAction('FOO', props<[]>()); `).toFail( - /Argument of type '"arrays are not allowed in action creators"' is not assignable to parameter of type/ + /Type 'Props<\[\]>' is not assignable to type '"arrays are not allowed in action creators"'/ ); }); }); @@ -80,7 +80,7 @@ describe('createAction()', () => { expectSnippet(` const foo = createAction('FOO', (type: string) => ({type})); `).toFail( - /Type '{ type: string; }' is not assignable to type '"type property is not allowed in action creators"'/ + /Type '\(type: string\) => \{ type: string; \}' is not assignable to type '"type property is not allowed in action creators"'/ ); }); @@ -88,7 +88,7 @@ describe('createAction()', () => { expectSnippet(` const foo = createAction('FOO', () => [ ]); `).toFail( - /Type 'any\[]' is not assignable to type '"arrays are not allowed in action creators"'/ + /Type '\(\) => any\[\]' is not assignable to type '"arrays are not allowed in action creators"'/ ); }); }); diff --git a/modules/store/spec/types/utils.ts b/modules/store/spec/types/utils.ts index 019d47df49..24f2eada6a 100644 --- a/modules/store/spec/types/utils.ts +++ b/modules/store/spec/types/utils.ts @@ -2,6 +2,7 @@ export const compilerOptions = () => ({ moduleResolution: 'node', target: 'es2015', baseUrl: '.', + experimentalDecorators: true, paths: { '@ngrx/store': ['./modules/store'], }, diff --git a/modules/store/src/action_creator.ts b/modules/store/src/action_creator.ts index 492fbedf8d..341bb5b79b 100644 --- a/modules/store/src/action_creator.ts +++ b/modules/store/src/action_creator.ts @@ -15,7 +15,7 @@ export function createAction( ): ActionCreator TypedAction>; export function createAction( type: T, - config: Props

+ config: Props

& NotAllowedCheck

): ActionCreator) => P & TypedAction>; export function createAction< T extends string,