From d720252c580da12338f05c1c84de79098dd22309 Mon Sep 17 00:00:00 2001 From: Masahiko Sakakibara Date: Mon, 17 Jan 2022 18:30:49 +0900 Subject: [PATCH] fix(test): remove @ngrx/store import Replace @ngrx/store INIT and UPDATE imports with hardcoded strings. This was done to fix a module resolution issue where the tests couldn't run --- projects/lib/src/lib/index.ts | 9 +++++---- spec/index_spec.ts | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/projects/lib/src/lib/index.ts b/projects/lib/src/lib/index.ts index 3e730bb..648d2b6 100644 --- a/projects/lib/src/lib/index.ts +++ b/projects/lib/src/lib/index.ts @@ -1,8 +1,9 @@ import deepmerge from 'deepmerge'; -import { - INIT as INIT_ACTION, - UPDATE as UPDATE_ACTION -} from '@ngrx/store'; + +// Cannot import from the @ngrx/store package due to a module resolution issue. +// See Issue #206. +const INIT_ACTION = '@ngrx/store/init'; +const UPDATE_ACTION = '@ngrx/store/update-reducers'; const detectDate = /(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})/; diff --git a/spec/index_spec.ts b/spec/index_spec.ts index 774fc42..a1b2612 100644 --- a/spec/index_spec.ts +++ b/spec/index_spec.ts @@ -4,7 +4,8 @@ import * as CryptoJS from 'crypto-js'; import deepmerge from 'deepmerge'; import 'localstorage-polyfill'; import { dateReviver, localStorageSync, rehydrateApplicationState, syncStateUpdate } from '../projects/lib/src/public_api'; -import { INIT as INIT_ACTION } from '@ngrx/store'; + +const INIT_ACTION = '@ngrx/store/init'; // Very simple classes to test serialization options. They cover string, number, date, and nested classes // The top level class has static functions to help test reviver, replacer, serialize and deserialize