Skip to content

Commit b605adc

Browse files
committed
support containers with DOs using ctx.exports
1 parent dd3ce70 commit b605adc

File tree

8 files changed

+475
-111
lines changed

8 files changed

+475
-111
lines changed

packages/wrangler/src/__tests__/containers/config.test.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ describe("getNormalizedContainerOptions", () => {
9797
},
9898
],
9999
},
100+
migrations: [{ tag: "v1", new_sqlite_classes: ["TestContainer"] }],
100101
} as Partial<Config> as Config;
101102

102103
await expect(getNormalizedContainerOptions(config, {})).rejects.toThrow(
@@ -132,6 +133,7 @@ describe("getNormalizedContainerOptions", () => {
132133
},
133134
],
134135
},
136+
migrations: [{ tag: "v1", new_sqlite_classes: ["TestContainer"] }],
135137
} as Partial<Config> as Config;
136138

137139
const result = await getNormalizedContainerOptions(config, {});
@@ -176,6 +178,7 @@ describe("getNormalizedContainerOptions", () => {
176178
},
177179
],
178180
},
181+
migrations: [{ tag: "v1", new_sqlite_classes: ["TestContainer"] }],
179182
} as Partial<Config> as Config;
180183

181184
const result = await getNormalizedContainerOptions(config, {});
@@ -219,6 +222,7 @@ describe("getNormalizedContainerOptions", () => {
219222
},
220223
],
221224
},
225+
migrations: [{ tag: "v1", new_sqlite_classes: ["TestContainer"] }],
222226
} as Partial<Config> as Config;
223227

224228
const result = await getNormalizedContainerOptions(config, {});
@@ -260,6 +264,7 @@ describe("getNormalizedContainerOptions", () => {
260264
},
261265
],
262266
},
267+
migrations: [{ tag: "v1", new_sqlite_classes: ["TestContainer"] }],
263268
} as Partial<Config> as Config;
264269

265270
const result = await getNormalizedContainerOptions(config, {});
@@ -307,6 +312,7 @@ describe("getNormalizedContainerOptions", () => {
307312
},
308313
],
309314
},
315+
migrations: [{ tag: "v1", new_sqlite_classes: ["TestContainer"] }],
310316
} as Partial<Config> as Config;
311317

312318
const result = await getNormalizedContainerOptions(config, {});
@@ -351,6 +357,7 @@ describe("getNormalizedContainerOptions", () => {
351357
},
352358
],
353359
},
360+
migrations: [{ tag: "v1", new_sqlite_classes: ["TestContainer"] }],
354361
} as Partial<Config> as Config;
355362

356363
const result = await getNormalizedContainerOptions(config, {});
@@ -393,6 +400,7 @@ describe("getNormalizedContainerOptions", () => {
393400
},
394401
],
395402
},
403+
migrations: [{ tag: "v1", new_sqlite_classes: ["TestContainer"] }],
396404
} as Partial<Config> as Config;
397405

398406
const result = await getNormalizedContainerOptions(config, {});
@@ -448,6 +456,7 @@ describe("getNormalizedContainerOptions", () => {
448456
},
449457
],
450458
},
459+
migrations: [{ tag: "v1", new_sqlite_classes: ["TestContainer"] }],
451460
} as Partial<Config> as Config;
452461

453462
const result = await getNormalizedContainerOptions(config, {});
@@ -500,6 +509,7 @@ describe("getNormalizedContainerOptions", () => {
500509
},
501510
],
502511
},
512+
migrations: [{ tag: "v1", new_sqlite_classes: ["TestContainer"] }],
503513
} as Partial<Config> as Config;
504514

505515
const result = await getNormalizedContainerOptions(config, {});
@@ -552,6 +562,9 @@ describe("getNormalizedContainerOptions", () => {
552562
},
553563
],
554564
},
565+
migrations: [
566+
{ tag: "v1", new_sqlite_classes: ["Container1", "Container2"] },
567+
],
555568
} as Partial<Config> as Config;
556569

557570
const result = await getNormalizedContainerOptions(config, {});
@@ -583,6 +596,7 @@ describe("getNormalizedContainerOptions", () => {
583596
},
584597
],
585598
},
599+
migrations: [{ tag: "v1", new_sqlite_classes: ["TestContainer"] }],
586600
} as Partial<Config> as Config;
587601

588602
const result = await getNormalizedContainerOptions(config, {});
@@ -615,6 +629,7 @@ describe("getNormalizedContainerOptions", () => {
615629
},
616630
],
617631
},
632+
migrations: [{ tag: "v1", new_sqlite_classes: ["TestContainer"] }],
618633
} as Partial<Config> as Config;
619634

620635
const result = await getNormalizedContainerOptions(config, {});
@@ -644,6 +659,7 @@ describe("getNormalizedContainerOptions", () => {
644659
},
645660
],
646661
},
662+
migrations: [{ tag: "v1", new_sqlite_classes: ["TestContainer"] }],
647663
} as Partial<Config> as Config;
648664

649665
const result = await getNormalizedContainerOptions(config, {});
@@ -675,6 +691,7 @@ describe("getNormalizedContainerOptions", () => {
675691
},
676692
],
677693
},
694+
migrations: [{ tag: "v1", new_sqlite_classes: ["TestContainer"] }],
678695
} as Partial<Config> as Config;
679696
await expect(getNormalizedContainerOptions(config, {})).rejects
680697
.toThrowErrorMatchingInlineSnapshot(`
@@ -706,6 +723,7 @@ describe("getNormalizedContainerOptions", () => {
706723
},
707724
],
708725
},
726+
migrations: [{ tag: "v1", new_sqlite_classes: ["TestContainer"] }],
709727
} as Partial<Config> as Config;
710728
const result = await getNormalizedContainerOptions(config, {});
711729
expect(result).toHaveLength(1);
@@ -737,6 +755,7 @@ describe("getNormalizedContainerOptions", () => {
737755
},
738756
],
739757
},
758+
migrations: [{ tag: "v1", new_sqlite_classes: ["TestContainer"] }],
740759
} as Partial<Config> as Config;
741760
const result = await getNormalizedContainerOptions(config, {
742761
dryRun: true,

0 commit comments

Comments
 (0)