title: Testing @ngrx/Effect with jest
body: <p>I am trying to test @ngrx/Effect with Jest <a href="https://brianflove.com/2018/06/28/ngrx-testing-effects/" rel="nofollow noreferrer">following this article</a> but I keep having the same error no matter what. The <a href="https://github.com/ngrx/platform/blob/6.1.0/docs/effects/testing.md" rel="nofollow noreferrer">official doc</a> I also followed did not help to get past it either. I don't understand what I did wrong here :(</p>
  
  <p>Angular: 6.1.0</p>
  
  <p>ngrx: 6.1.0</p>
  
  <p>I am also using @nrwl/nx (6.3.0)</p>
  
  <p>My spec file:</p>
  
  <pre><code>describe('AuthenticationEffects', () =&gt; {
    let actions: Observable&lt;any&gt;;
    let effects: AuthenticationEffects;
    let authenticationService: AuthService;
  
    beforeEach(() =&gt; {
      TestBed.configureTestingModule({
        declarations: [],
        providers: [
          AuthenticationEffects,
          provideMockActions(() =&gt; actions),
          {
            provide: AuthService,
            useValue: {
              login: jest.fn(),
              logout: jest.fn()
            }
          }
        ]
      });
    });
  
    beforeEach(() =&gt; {
      effects = TestBed.get(AuthenticationEffects);
      authenticationService = TestBed.get(AuthService);
    });
  
    it('should be created', () =&gt; {
      expect(effects).toBeTruthy();
    });
  });
  </code></pre>
  
  <p>Jest output</p>
  
  <pre><code>  ● AuthenticationEffects › should be created
  
      TypeError: Cannot read property 'getComponentFromError' of null
  
        at TestBed.Object.&lt;anonymous&gt;.TestBed._initIfNeeded (../../packages/core/testing/src/test_bed.ts:351:46)      at TestBed.Object.&lt;anonymous&gt;.TestBed.get (../../packages/core/testing/src/test_bed.ts:431:10)      at Function.Object.&lt;anonymous&gt;.TestBed.get (../../packages/core/testing/src/test_bed.ts:197:25)      at Object.&lt;anonymous&gt; (libs/authentication/src/lib/store/effects/authentication.effect.spec.ts:50:23)
    ● AuthenticationEffects › should be created
  
      expect(received).toBeTruthy()
  
      Received: undefined
  
        53 |
        54 |   it('should be created', () =&gt; {
      &gt; 55 |     expect(effects).toBeTruthy();
           |                     ^
        56 |   });
        57 |
  
  
        at Object.&lt;anonymous&gt; (libs/authentication/src/lib/store/effects/authentication.effect.spec.ts:55:21)
  </code></pre>
  
  <p><strong>Edit 1</strong></p>
  
  <p>More clues!</p>
  
  <p>jest.config.js</p>
  
  <pre><code>module.exports = {
    testMatch: ['**/+(*.)+(spec|test).+(ts|js)?(x)'],
    transform: {
      '^.+\\.(ts|js|html)$': 'jest-preset-angular/preprocessor.js'
    },
    resolver: '@nrwl/builders/plugins/jest/resolver',
    moduleFileExtensions: ['ts', 'js', 'html'],
    collectCoverage: true,
    coverageReporters: ['html']
  };
  </code></pre>
  
  <p>Package.json Jest-related config &amp; dependencies</p>
  
  <pre><code>[...]
  "jest": {
      "preset": "jest-preset-angular",
      "setupTestFrameworkScriptFile": "&lt;rootDir&gt;/jest/setupJest.ts",
      "globals": {
        "ts-jest": {
          "tsConfigFile": "tsconfig.spec.json"
        },
        "__TRANSFORM_HTML__": true,
        "testResultsProcessor": "./node_modules/jest-html-reporter"
      },
      "collectCoverageFrom": [
        "{apps|libs}/**/src/**/*.ts",
        "!jest/*.ts",
        "!{apps|libs}/**/src/**/*module.ts",
        "!apps/**/src/environments/*.ts",
        "!apps/**/src/main.ts",
        "!apps/**/src/polyfills.ts"
      ],
      "coveragePathIgnorePatterns": [
        "/node_modules/",
        "index.ts"
      ],
      "coverageThreshold": {
        "global": {
          "branches": 60,
          "functions": 60,
          "lines": 60,
          "statements": -20
        }
      },
      "moduleNameMapper": {
        "@sk-frontend/(.*)": "&lt;rootDir&gt;/libs/$1"
      }
    },
    "jest-html-reporter": {
      "pageTitle": "Your test suite",
      "outputPath": "coverage/index.html",
      "includeFailureMsg": false
    },
    "dependencies": {
      "@angular/animations": "^6.1.0",
      "@angular/common": "^6.1.0",
      "@angular/compiler": "^6.1.0",
      "@angular/core": "^6.1.0",
      "@angular/forms": "^6.1.0",
      "@angular/platform-browser": "^6.1.0",
      "@angular/platform-browser-dynamic": "^6.1.0",
      "@angular/pwa": "^0.8.1",
      "@angular/router": "^6.1.0",
      "@angular/service-worker": "^6.1.0",
      "@ngrx/effects": "^6.1.0",
      "@ngrx/entity": "^6.1.0",
      "@ngrx/router-store": "6.1.0",
      "@ngrx/store": "^6.1.0",
      "@nrwl/nx": "6.3.0",
      "core-js": "^2.5.4",
      "js-sha256": "^0.9.0",
      "rxjs": "^6.0.0",
      "zone.js": "^0.8.26"
    },
    "devDependencies": {
      "@angular-devkit/build-angular": "~0.7.0",
      "@angular/bazel": "^6.1.7",
      "@angular/cli": "6.1.2",
      "@angular/compiler-cli": "^6.1.0",
      "@angular/language-service": "^6.1.0",
      "@ngrx/schematics": "^6.1.0",
      "@ngrx/store-devtools": "^6.1.0",
      "@nrwl/builders": "6.3.0",
      "@nrwl/schematics": "6.3.0",
      "@types/jasmine": "~2.8.6",
      "@types/jasminewd2": "~2.0.3",
      "@types/jest": "^23.0.0",
      "@types/node": "~8.9.4",
      "codelyzer": "~4.2.1",
      "jasmine-core": "~2.99.1",
      "jasmine-marbles": "^0.3.1",
      "jasmine-spec-reporter": "~4.2.1",
      "jest": "^23.0.0",
      "jest-preset-angular": "6.0.0",
      "jsonwebtoken": "^8.3.0",
      "karma": "^3.0.0",
      "karma-chrome-launcher": "~2.2.0",
      "karma-coverage-istanbul-reporter": "~1.4.2",
      "karma-jasmine": "~1.1.0",
      "karma-jasmine-html-reporter": "^0.2.2",
      "ngrx-store-freeze": "0.2.4",
      "prettier": "1.13.7",
      "protractor": "^5.4.1",
      "ts-node": "~5.0.1",
      "tslint": "~5.9.1",
      "typescript": "~2.7.2"
    }
  [...]
  </code></pre>
  
  <p>Module</p>
  
  <pre><code>@NgModule({
    imports: [
      CommonModule,
      HttpClientModule,
      StoreModule.forFeature('authentication', fromAuthentication.reducer),
      EffectsModule.forFeature([AuthenticationEffects])
    ],
    providers: [
      {
        provide: AUTHENTICATION_CONFIG,
        useValue: authenticationConfigDefault
      },
      {
        provide: HTTP_INTERCEPTORS,
        useClass: AuthenticationTokenInterceptor,
        multi: true
      }
    ]
  })
  export class AuthenticationModule {}
  </code></pre>