import { SupabaseClient } from "jsr:@supabase/supabase-js";
import { SpotifyUserPlaying, MockUserPlaying } from "../../src/music/UserPlaying.ts";
import { Client, Player } from "npm:spotify-api.js@latest";
import { expect } from "jsr:@std/expect";
Deno.test("User Playing Tests", async (t: Deno.TestContext) => {
console.log("test env", Deno.env.get("SB_URL_TEST"))
const supabase: SupabaseClient<any, "test", any> = new SupabaseClient(
Deno.env.get("SB_URL_TEST") as string,
Deno.env.get("ANON") as string,
{ db: { schema: "test" } }
);
const { data, error } = await supabase.auth.signUp({
email: "test1@example.com",
password: "password",
});
if (error) throw error;
const userId = data.user?.id || "";
await t.step("MockUserPlaying init method", async () => {
const mockUserPlaying = new MockUserPlaying(supabase, userId, testData1);
await expect(mockUserPlaying.init()).resolves.not.toThrow();
});
await supabase.auth.admin.deleteUser(userId);
});
import { SupabaseClient } from "jsr:@supabase/supabase-js";
import { SpotifyUserPlaying, MockUserPlaying } from "../../src/music/UserPlaying.ts";
import { Client, Player } from "npm:spotify-api.js@latest";
import { expect } from "jsr:@std/expect";
Deno.test("User Playing Tests", async (t: Deno.TestContext) => {
console.log("test env", Deno.env.get("SB_URL_TEST"))
const supabase: SupabaseClient<any, "test", any> = new SupabaseClient(
Deno.env.get("SB_URL_TEST") as string,
Deno.env.get("ANON") as string,
{ db: { schema: "test" } }
);
const { data, error } = await supabase.auth.signUp({
email: "test1@example.com",
password: "password",
});
if (error) throw error;
const userId = data.user?.id || "";
await t.step("MockUserPlaying init method", async () => {
const mockUserPlaying = new MockUserPlaying(supabase, userId, testData1);
await expect(mockUserPlaying.init()).resolves.not.toThrow();
});
await supabase.auth.admin.deleteUser(userId);
});