Hi Alisa
Sorry, it’s difficult to explain, to test this I’ve converted my app.component.ts to use the inject() function (not in the constructor as mentioned in the GH ticket) and also changed the authService.service.ts to also use inject() and removed the constructor and any DI’s it had.
The unit test is really simple and just creates an instance of app.component.ts. The app.component.ts has an inject() to authService and this is now set up like
@Inject(OKTA_AUTH) private oktaAuth = inject(OktaAuth, { optional: true });
But the test still fails
FAIL src/app/app.component.spec.ts [ src/app/app.component.spec.ts ]
TypeError: Cannot read properties of undefined (reading ‘operators’)
❯ node_modules/okta/okta-angular/bundles/okta-okta-angular.umd.js:4:240
❯ node_modules/okta/okta-angular/bundles/okta-okta-angular.umd.js:5:3
❯ src/app/core/services/auth.service.ts:6:31
(@ symbols removed from node_modules/okta/okta-angular as I’m still restricted)
Test Files 1 failed (1)
Tests no tests
Start at 11:16:07
Duration 14.15s (transform 2.08s, setup 1.16s, collect 0ms, tests 0ms, environment 7.76s, prepare 8.86s)
as a side note, in the error above it refers to line 6:31, this is line 6, column 31 is the t in Injectable, not sure if this helps or not.
import { Inject, inject, Injectable, OnDestroy } from ‘@angular/core’;
Edit:
looking at the okta-okta-angular.umd.js file line 5:3 refers to
(this, (function (exports, i0, router, common, i2, operators, rxjs, compareVersions)
and I guess it’s this operators that it’s having issues with.