mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 16:53:34 +00:00
[ADR-0006][AC-319] Migrate all tests to use jest mock instead of substitute (#6520)
Standardize on using jest mock instead of having two mocking frameworks which can be confusing.
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
import { NO_ERRORS_SCHEMA } from "@angular/core";
|
||||
import { ComponentFixture, TestBed } from "@angular/core/testing";
|
||||
import { ActivatedRoute } from "@angular/router";
|
||||
// eslint-disable-next-line no-restricted-imports
|
||||
import { Substitute } from "@fluffy-spoon/substitute";
|
||||
import { mock, MockProxy } from "jest-mock-extended";
|
||||
|
||||
import { I18nPipe } from "@bitwarden/angular/platform/pipes/i18n.pipe";
|
||||
@@ -28,15 +26,15 @@ describe("GeneratorComponent", () => {
|
||||
providers: [
|
||||
{
|
||||
provide: PasswordGenerationServiceAbstraction,
|
||||
useClass: Substitute.for<PasswordGenerationServiceAbstraction>(),
|
||||
useValue: mock<PasswordGenerationServiceAbstraction>(),
|
||||
},
|
||||
{
|
||||
provide: UsernameGenerationServiceAbstraction,
|
||||
useClass: Substitute.for<UsernameGenerationServiceAbstraction>(),
|
||||
useValue: mock<UsernameGenerationServiceAbstraction>(),
|
||||
},
|
||||
{
|
||||
provide: StateService,
|
||||
useClass: Substitute.for<StateService>(),
|
||||
useValue: mock<StateService>(),
|
||||
},
|
||||
{
|
||||
provide: PlatformUtilsService,
|
||||
@@ -44,15 +42,15 @@ describe("GeneratorComponent", () => {
|
||||
},
|
||||
{
|
||||
provide: I18nService,
|
||||
useClass: Substitute.for<I18nService>(),
|
||||
useValue: mock<I18nService>(),
|
||||
},
|
||||
{
|
||||
provide: ActivatedRoute,
|
||||
useClass: Substitute.for<ActivatedRoute>(),
|
||||
useValue: mock<ActivatedRoute>(),
|
||||
},
|
||||
{
|
||||
provide: LogService,
|
||||
useClass: Substitute.for<LogService>(),
|
||||
useValue: mock<LogService>(),
|
||||
},
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
|
||||
Reference in New Issue
Block a user