Skip to content

Commit ed327ef

Browse files
committed
Use valid prediction IDs in tests
We don't use `-` in IDs.
1 parent 4a5b03a commit ed327ef

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

lib/Prediction.test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,26 @@ beforeEach(() => {
1616
process.env.REPLICATE_API_TOKEN = "test-token-from-env";
1717

1818
client = new ReplicateClient({});
19-
prediction = client.prediction("test-prediction");
19+
prediction = client.prediction("testprediction");
2020
});
2121

2222
describe("load()", () => {
2323
it("makes request to get prediction", async () => {
2424
jest.spyOn(client, "request").mockResolvedValue({
25-
id: "test-prediction",
25+
id: "testprediction",
2626
status: PredictionStatus.SUCCEEDED,
2727
});
2828

2929
await prediction.load();
3030

3131
expect(client.request).toHaveBeenCalledWith(
32-
"GET /v1/predictions/test-prediction"
32+
"GET /v1/predictions/testprediction"
3333
);
3434
});
3535

36-
it("returns a Prediction", async () => {
36+
it("returns Prediction", async () => {
3737
jest.spyOn(client, "request").mockResolvedValue({
38-
id: "test-prediction",
38+
id: "testprediction",
3939
status: PredictionStatus.SUCCEEDED,
4040
});
4141

@@ -46,7 +46,7 @@ describe("load()", () => {
4646

4747
it("updates the prediction in place", async () => {
4848
jest.spyOn(client, "request").mockResolvedValue({
49-
id: "test-prediction",
49+
id: "testprediction",
5050
status: PredictionStatus.SUCCEEDED,
5151
});
5252

lib/ReplicateClient.test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ describe("request()", () => {
7070
});
7171

7272
await expect(
73-
async () => await client.request("GET /v1/predictions/test-id")
73+
async () => await client.request("GET /v1/predictions/testprediction")
7474
).rejects.toThrowError(ReplicateRequestError);
7575
await expect(
76-
async () => await client.request("GET /v1/predictions/test-id")
76+
async () => await client.request("GET /v1/predictions/testprediction")
7777
).rejects.toThrowError(
78-
"Failed to make request: method=GET, url=https://api.replicate.com/v1/predictions/test-id, body=undefined"
78+
"Failed to make request: method=GET, url=https://api.replicate.com/v1/predictions/testprediction, body=undefined"
7979
);
8080
});
8181

@@ -89,12 +89,12 @@ describe("request()", () => {
8989
);
9090

9191
await expect(
92-
async () => await client.request("GET /v1/predictions/test-id")
92+
async () => await client.request("GET /v1/predictions/testprediction")
9393
).rejects.toThrowError(ReplicateResponseError);
9494
await expect(
95-
async () => await client.request("GET /v1/predictions/test-id")
95+
async () => await client.request("GET /v1/predictions/testprediction")
9696
).rejects.toThrowError(
97-
"403 Unauthorized for GET /v1/predictions/test-id: Something went wrong"
97+
"403 Unauthorized for GET /v1/predictions/testprediction: Something went wrong"
9898
);
9999
});
100100
});

0 commit comments

Comments
 (0)