Skip to content

Commit

Permalink
try fix for test
Browse files Browse the repository at this point in the history
  • Loading branch information
lakhoune committed Dec 15, 2023
1 parent 4ca2370 commit 3ca25cd
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/app/cv-redirect.guard.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { TestBed } from '@angular/core/testing';
import { CanActivateFn } from '@angular/router';
import { CanActivateFn, Router } from '@angular/router';

import { cvRedirectGuard } from './cv-redirect.guard';
import { CvRedirectGuard } from './cv-redirect.guard';

describe('cvRedirectGuard', () => {
const executeGuard: CanActivateFn = (...guardParameters) =>
TestBed.runInInjectionContext(() => cvRedirectGuard(...guardParameters));
const executeGuard: CanActivateFn = (...guardParameters) =>
TestBed.runInInjectionContext(
() => new CvRedirectGuard(TestBed.inject(Router)) // Pass the Router instance
).canActivate(...guardParameters);

beforeEach(() => {
TestBed.configureTestingModule({});
Expand Down

0 comments on commit 3ca25cd

Please sign in to comment.