wrangler 2.0.9 → 2.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/__tests__/configuration.test.ts +34 -0
- package/src/__tests__/publish.test.ts +244 -131
- package/src/config/validation-helpers.ts +10 -1
- package/src/pages.tsx +295 -240
- package/src/sites.tsx +49 -16
- package/wrangler-dist/cli.js +227 -167
package/package.json
CHANGED
|
@@ -438,6 +438,40 @@ describe("normalizeAndValidateConfig()", () => {
|
|
|
438
438
|
expect(diagnostics.hasWarnings()).toBe(false);
|
|
439
439
|
});
|
|
440
440
|
|
|
441
|
+
it("should warn on unexpected fields on `triggers`", async () => {
|
|
442
|
+
const expectedConfig: RawConfig = {
|
|
443
|
+
triggers: {
|
|
444
|
+
crons: ["1 * * * *"],
|
|
445
|
+
// @ts-expect-error we're purposely adding a field
|
|
446
|
+
// that doesn't belong here
|
|
447
|
+
someOtherfield: 123,
|
|
448
|
+
},
|
|
449
|
+
};
|
|
450
|
+
|
|
451
|
+
const { config, diagnostics } = normalizeAndValidateConfig(
|
|
452
|
+
expectedConfig,
|
|
453
|
+
"project/wrangler.toml",
|
|
454
|
+
{ env: undefined }
|
|
455
|
+
);
|
|
456
|
+
|
|
457
|
+
expect(config).toEqual(
|
|
458
|
+
expect.objectContaining({
|
|
459
|
+
triggers: {
|
|
460
|
+
crons: ["1 * * * *"],
|
|
461
|
+
someOtherfield: 123,
|
|
462
|
+
},
|
|
463
|
+
})
|
|
464
|
+
);
|
|
465
|
+
expect(diagnostics.hasErrors()).toBe(false);
|
|
466
|
+
expect(diagnostics.hasWarnings()).toBe(true);
|
|
467
|
+
|
|
468
|
+
expect(normalizePath(diagnostics.renderWarnings()))
|
|
469
|
+
.toMatchInlineSnapshot(`
|
|
470
|
+
"Processing project/wrangler.toml configuration:
|
|
471
|
+
- Unexpected fields found in triggers field: \\"someOtherfield\\""
|
|
472
|
+
`);
|
|
473
|
+
});
|
|
474
|
+
|
|
441
475
|
it("should error on invalid `wasm_modules` paths", () => {
|
|
442
476
|
const expectedConfig = {
|
|
443
477
|
wasm_modules: {
|