Skip to content

Commit

Permalink
fix: some tests were hitting production
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeocodes committed Aug 5, 2024
1 parent f465816 commit ff05cf6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion test/manage_rest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ describe("making manage REST requests", () => {
// Add your assertions for the response data here
});

it("should retrieve a models", async () => {
it("should retrieve a model", async () => {
const { result, error } = await deepgram.manage.getModel(
faker.string.uuid(),
faker.string.uuid()
Expand Down
16 changes: 9 additions & 7 deletions test/models_rest.test.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
import { assert } from "chai";
import { createClient } from "../src";
import { faker } from "@faker-js/faker";
import { ModelsRestClient } from "../src/packages";
import DeepgramClient from "../src/DeepgramClient";

describe("ModelsRestClient", () => {
let modelsRestClient: ModelsRestClient;
describe("making models REST requests", () => {
let deepgram: DeepgramClient;

beforeEach(() => {
modelsRestClient = createClient(faker.string.alphanumeric(40)).models;
deepgram = createClient(faker.string.alphanumeric(40), {
global: { url: "https://api.mock.deepgram.com" },
});
});

it("should retrieve a list of models", async () => {
const { result, error } = await modelsRestClient.getAll();
const { result, error } = await deepgram.models.getAll();

assert.isNull(error);
assert.isNotNull(result);
});

it("should retrieve a models", async () => {
const { result, error } = await modelsRestClient.getModel(faker.string.uuid());
it("should retrieve a model", async () => {
const { result, error } = await deepgram.models.getModel(faker.string.uuid());

assert.isNull(error);
assert.isNotNull(result);
Expand Down

0 comments on commit ff05cf6

Please sign in to comment.