Skip to content

Commit

Permalink
Merge pull request #138 from HassanBahati/dc-web-sdk-firebase-version
Browse files Browse the repository at this point in the history
  • Loading branch information
Ehesp authored Dec 30, 2024
2 parents fd0a466 + 4c03b9e commit d4d23ef
Show file tree
Hide file tree
Showing 18 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion dataconnect-sdk/js/default-connector/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
"./package.json": "./package.json"
},
"peerDependencies": {
"firebase": "^10.14.0 || ^11.0.0"
"firebase": "^11.1.0"
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"scripts": {
"test": "vitest --dom --coverage",
"serve:coverage": "npx serve coverage",
"emulator": "firebase emulators:start --project demo-projectc",
"emulator": "firebase emulators:start --project test-project",
"emulator:kill": "lsof -t -i:4001 -i:8080 -i:9000 -i:9099 -i:9199 -i:8085 | xargs kill -9",
"check": "pnpm biome check --write ./packages/react/src"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/auth/useDeleteUserMutation.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { act, renderHook, waitFor } from "@testing-library/react";
import { type User, createUserWithEmailAndPassword } from "firebase/auth";
import type React from "react";
import React, { type ReactNode } from "react";
import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
import { auth, wipeAuth } from "~/testing-utils";
import { useDeleteUserMutation } from "./useDeleteUserMutation";
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/auth/useReloadMutation.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
createUserWithEmailAndPassword,
signInWithEmailAndPassword,
} from "firebase/auth";
import type React from "react";
import React, { type ReactNode } from "react";
import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
import { auth, wipeAuth } from "~/testing-utils";
import { useReloadMutation } from "./useReloadMutation";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { act, renderHook, waitFor } from "@testing-library/react";
import type React from "react";
import React, { type ReactNode } from "react";
import { beforeEach, describe, expect, test } from "vitest";
import { auth, wipeAuth } from "~/testing-utils";
import { useSendSignInLinkToEmailMutation } from "./useSendSignInLinkToEmailMutation";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { act, renderHook, waitFor } from "@testing-library/react";
import type React from "react";
import React, { type ReactNode } from "react";
import {
type MockInstance,
afterEach,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { act, renderHook, waitFor } from "@testing-library/react";
import { GoogleAuthProvider } from "firebase/auth";
import jwt from "jsonwebtoken";
import type React from "react";
import React, { type ReactNode } from "react";
import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
import { auth, expectFirebaseError, wipeAuth } from "~/testing-utils";
import { useSignInWithCredentialMutation } from "./useSignInWithCredentialMutation";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { act, renderHook, waitFor } from "@testing-library/react";
import { createUserWithEmailAndPassword } from "firebase/auth";
import type React from "react";
import React, { type ReactNode } from "react";
import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
import { auth, wipeAuth } from "~/testing-utils";
import { useSignInWithEmailAndPasswordMutation } from "./useSignInWithEmailAndPasswordMutation";
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/auth/useSignOutMutation.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
createUserWithEmailAndPassword,
signInWithEmailAndPassword,
} from "firebase/auth";
import type React from "react";
import React, { type ReactNode } from "react";
import { beforeEach, describe, expect, test, vi } from "vitest";
import { auth, wipeAuth } from "~/testing-utils";
import { useSignOutMutation } from "./useSignOutMutation";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
createUserWithEmailAndPassword,
signInWithEmailAndPassword,
} from "firebase/auth";
import type React from "react";
import React, { type ReactNode } from "react";
import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
import { auth, wipeAuth } from "~/testing-utils";
import { useUpdateCurrentUserMutation } from "./useUpdateCurrentUserMutation";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
createUserWithEmailAndPassword,
sendPasswordResetEmail,
} from "firebase/auth";
import type React from "react";
import React, { type ReactNode } from "react";
import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
import { auth, wipeAuth } from "~/testing-utils";
import { useVerifyPasswordResetCodeMutation } from "./useVerifyPasswordResetCodeMutation";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { act, renderHook, waitFor } from "@testing-library/react";
import type React from "react";
import React, { type ReactNode } from "react";
import { beforeEach, describe, expect, test, vi } from "vitest";
import { firestore, wipeFirestore } from "~/testing-utils";
import { useClearIndexedDbPersistenceMutation } from "./useClearIndexedDbPersistenceMutation";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { act, renderHook, waitFor } from "@testing-library/react";
import { doc, enableNetwork, getDocFromServer } from "firebase/firestore";
import type React from "react";
import React, { type ReactNode } from "react";
import { beforeEach, describe, expect, test, vi } from "vitest";
import {
expectFirestoreError,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { act, renderHook, waitFor } from "@testing-library/react";
import { type Transaction, doc, getDoc, setDoc } from "firebase/firestore";
import type React from "react";
import React, { type ReactNode } from "react";
import { beforeEach, describe, expect, test, vi } from "vitest";
import { firestore, wipeFirestore } from "~/testing-utils";
import { useRunTransactionMutation } from "./useRunTransactionMutation";
Expand All @@ -13,7 +13,7 @@ const queryClient = new QueryClient({
},
});

const wrapper = ({ children }: { children: React.ReactNode }) => (
const wrapper = ({ children }: { children: ReactNode }) => (
<QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { act, renderHook, waitFor } from "@testing-library/react";
import { doc, setDoc } from "firebase/firestore";
import type React from "react";
import React, { type ReactNode } from "react";
import { beforeEach, describe, expect, test, vi } from "vitest";
import {
expectFirestoreError,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { act, renderHook, waitFor } from "@testing-library/react";
import { doc, getDoc, setDoc, writeBatch } from "firebase/firestore";
import type React from "react";
import React, { type ReactNode } from "react";
import { beforeEach, describe, expect, test } from "vitest";
import { firestore, wipeFirestore } from "~/testing-utils";
import { useWriteBatchCommitMutation } from "./useWriteBatchCommitMutation";
Expand Down
4 changes: 2 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions vitest/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
import { connectorConfig } from "@/dataconnect/default-connector";

const firebaseTestingOptions = {
projectId: "demo-project",
projectId: "test-project",
apiKey: "test-api-key",
authDomain: "test-auth-domain",
};
Expand All @@ -38,7 +38,7 @@ if (!firebaseApp) {

async function wipeFirestore() {
const response = await fetch(
"http://localhost:8080/emulator/v1/projects/demo-project/databases/(default)/documents",
"http://localhost:8080/emulator/v1/projects/test-project/databases/(default)/documents",
{
method: "DELETE",
}
Expand All @@ -51,7 +51,7 @@ async function wipeFirestore() {

async function wipeAuth() {
const response = await fetch(
"http://localhost:9099/emulator/v1/projects/demo-project/accounts",
"http://localhost:9099/emulator/v1/projects/test-project/accounts",
{
method: "DELETE",
}
Expand Down

0 comments on commit d4d23ef

Please sign in to comment.