mirror of
https://github.com/bitwarden/browser
synced 2026-03-01 02:51:24 +00:00
[PM-16917] Remove jest-extended dependency (#12798)
* add toContainPartialObjects matcher (replacing toIncludeAllPartialMembers from jest-extended) * replace jest-extended matchers with equivalent default matchers
This commit is contained in:
@@ -91,7 +91,7 @@ describe("DefaultvNextCollectionService", () => {
|
||||
|
||||
// Assert emitted values
|
||||
expect(result.length).toBe(2);
|
||||
expect(result).toIncludeAllPartialMembers([
|
||||
expect(result).toContainPartialObjects([
|
||||
{
|
||||
id: collection1.id,
|
||||
name: "DEC_NAME_" + collection1.id,
|
||||
@@ -167,7 +167,7 @@ describe("DefaultvNextCollectionService", () => {
|
||||
const result = await firstValueFrom(collectionService.encryptedCollections$(userId));
|
||||
|
||||
expect(result.length).toBe(2);
|
||||
expect(result).toIncludeAllPartialMembers([
|
||||
expect(result).toContainPartialObjects([
|
||||
{
|
||||
id: collection1.id,
|
||||
name: makeEncString("ENC_NAME_" + collection1.id),
|
||||
@@ -205,7 +205,7 @@ describe("DefaultvNextCollectionService", () => {
|
||||
|
||||
const result = await firstValueFrom(collectionService.encryptedCollections$(userId));
|
||||
expect(result.length).toBe(3);
|
||||
expect(result).toIncludeAllPartialMembers([
|
||||
expect(result).toContainPartialObjects([
|
||||
{
|
||||
id: collection1.id,
|
||||
name: makeEncString("UPDATED_ENC_NAME_" + collection1.id),
|
||||
@@ -230,7 +230,7 @@ describe("DefaultvNextCollectionService", () => {
|
||||
|
||||
const result = await firstValueFrom(collectionService.encryptedCollections$(userId));
|
||||
expect(result.length).toBe(1);
|
||||
expect(result).toIncludeAllPartialMembers([
|
||||
expect(result).toContainPartialObjects([
|
||||
{
|
||||
id: collection1.id,
|
||||
name: makeEncString("ENC_NAME_" + collection1.id),
|
||||
@@ -253,7 +253,7 @@ describe("DefaultvNextCollectionService", () => {
|
||||
|
||||
const result = await firstValueFrom(collectionService.encryptedCollections$(userId));
|
||||
expect(result.length).toBe(1);
|
||||
expect(result).toIncludeAllPartialMembers([
|
||||
expect(result).toContainPartialObjects([
|
||||
{
|
||||
id: newCollection3.id,
|
||||
name: makeEncString("ENC_NAME_" + newCollection3.id),
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
import { webcrypto } from "crypto";
|
||||
|
||||
import { addCustomMatchers } from "@bitwarden/common/spec";
|
||||
import "jest-preset-angular/setup-jest";
|
||||
|
||||
addCustomMatchers();
|
||||
|
||||
Object.defineProperty(window, "CSS", { value: null });
|
||||
Object.defineProperty(window, "getComputedStyle", {
|
||||
value: () => {
|
||||
|
||||
@@ -8,6 +8,6 @@
|
||||
"@bitwarden/key-management": ["../key-management/src"]
|
||||
}
|
||||
},
|
||||
"include": ["src", "spec"],
|
||||
"include": ["src", "spec", "../../libs/common/custom-matchers.d.ts"],
|
||||
"exclude": ["node_modules", "dist"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user