Skip to content

Commit e42aa29

Browse files
authored
Move min and max instances properties to deployment configuration (#232)
1 parent 049f77f commit e42aa29

File tree

2 files changed

+11
-23
lines changed

2 files changed

+11
-23
lines changed

index.d.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,8 @@ declare module "replicate" {
3333
created_by: Account;
3434
configuration: {
3535
hardware: string;
36-
scaling: {
37-
min_instances: number;
38-
max_instances: number;
39-
};
36+
min_instances: number;
37+
max_instances: number;
4038
};
4139
};
4240
}

index.test.ts

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -791,10 +791,8 @@ describe("Replicate client", () => {
791791
},
792792
configuration: {
793793
hardware: "gpu-t4",
794-
scaling: {
795-
min_instances: 1,
796-
max_instances: 5,
797-
},
794+
min_instances: 1,
795+
max_instances: 5,
798796
},
799797
},
800798
});
@@ -832,10 +830,8 @@ describe("Replicate client", () => {
832830
},
833831
configuration: {
834832
hardware: "gpu-t4",
835-
scaling: {
836-
min_instances: 1,
837-
max_instances: 5,
838-
},
833+
min_instances: 1,
834+
max_instances: 5,
839835
},
840836
},
841837
});
@@ -878,10 +874,8 @@ describe("Replicate client", () => {
878874
},
879875
configuration: {
880876
hardware: "gpu-a40-large",
881-
scaling: {
882-
min_instances: 3,
883-
max_instances: 10,
884-
},
877+
min_instances: 3,
878+
max_instances: 10,
885879
},
886880
},
887881
});
@@ -905,12 +899,8 @@ describe("Replicate client", () => {
905899
expect(deployment.current_release.configuration.hardware).toBe(
906900
"gpu-a40-large"
907901
);
908-
expect(
909-
deployment.current_release.configuration.scaling?.min_instances
910-
).toBe(3);
911-
expect(
912-
deployment.current_release.configuration.scaling?.max_instances
913-
).toBe(10);
902+
expect(deployment.current_release.configuration.min_instances).toBe(3);
903+
expect(deployment.current_release.configuration.max_instances).toBe(10);
914904
});
915905
// Add more tests for error handling, edge cases, etc.
916906
});
@@ -935,7 +925,7 @@ describe("Replicate client", () => {
935925
});
936926

937927
const deployments = await client.deployments.list();
938-
expect(deployments.results.length).toBe(1)
928+
expect(deployments.results.length).toBe(1);
939929
});
940930
// Add more tests for pagination, error handling, edge cases, etc.
941931
});

0 commit comments

Comments
 (0)