Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions packages/wrangler/src/__tests__/config/configuration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,11 @@ describe("normalizeAndValidateConfig()", () => {
);

expect(config).toEqual(
expect.objectContaining({ ...expectedConfig, main: undefined })
expect.objectContaining({
...expectedConfig,
main: undefined,
legacy_env: true,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change is irrelevant because we will have errored anyway.

})
);
expect(diagnostics.hasWarnings()).toBe(false);
expect(diagnostics.renderErrors()).toMatchInlineSnapshot(`
Expand Down Expand Up @@ -4958,9 +4962,9 @@ describe("normalizeAndValidateConfig()", () => {
expect(diagnostics.hasErrors()).toBe(false);
expect(diagnostics.hasWarnings()).toBe(true);
expect(diagnostics.renderWarnings()).toMatchInlineSnapshot(`
"Processing wrangler configuration:
- Experimental: Service environments are in beta, and their behaviour is guaranteed to change in the future. DO NOT USE IN PRODUCTION."
`);
"Processing wrangler configuration:
- Service environments are deprecated, and will be removed in the future. DO NOT USE IN PRODUCTION."
`);
});

it("should error if named environment contains a `name` field, even if there is no top-level name", () => {
Expand All @@ -4984,9 +4988,9 @@ describe("normalizeAndValidateConfig()", () => {
expect(diagnostics.hasWarnings()).toBe(true);
expect(diagnostics.hasErrors()).toBe(true);
expect(diagnostics.renderWarnings()).toMatchInlineSnapshot(`
"Processing wrangler configuration:
- Experimental: Service environments are in beta, and their behaviour is guaranteed to change in the future. DO NOT USE IN PRODUCTION."
`);
"Processing wrangler configuration:
- Service environments are deprecated, and will be removed in the future. DO NOT USE IN PRODUCTION."
`);
expect(diagnostics.renderErrors()).toMatchInlineSnapshot(`
"Processing wrangler configuration:

Expand Down Expand Up @@ -5018,9 +5022,9 @@ describe("normalizeAndValidateConfig()", () => {
expect(diagnostics.hasWarnings()).toBe(true);
expect(diagnostics.hasErrors()).toBe(true);
expect(diagnostics.renderWarnings()).toMatchInlineSnapshot(`
"Processing wrangler configuration:
- Experimental: Service environments are in beta, and their behaviour is guaranteed to change in the future. DO NOT USE IN PRODUCTION."
`);
"Processing wrangler configuration:
- Service environments are deprecated, and will be removed in the future. DO NOT USE IN PRODUCTION."
`);
expect(diagnostics.renderErrors()).toMatchInlineSnapshot(`
"Processing wrangler configuration:

Expand Down Expand Up @@ -5051,7 +5055,7 @@ describe("normalizeAndValidateConfig()", () => {
expect(config.account_id).toBeUndefined();
expect(diagnostics.renderWarnings()).toMatchInlineSnapshot(`
"Processing wrangler configuration:
- Experimental: Service environments are in beta, and their behaviour is guaranteed to change in the future. DO NOT USE IN PRODUCTION."
- Service environments are deprecated, and will be removed in the future. DO NOT USE IN PRODUCTION."
`);
expect(diagnostics.renderErrors()).toMatchInlineSnapshot(`
"Processing wrangler configuration:
Expand Down Expand Up @@ -5085,7 +5089,7 @@ describe("normalizeAndValidateConfig()", () => {
expect(diagnostics.hasWarnings()).toBe(true);
expect(diagnostics.renderWarnings()).toMatchInlineSnapshot(`
"Processing wrangler configuration:
- Experimental: Service environments are in beta, and their behaviour is guaranteed to change in the future. DO NOT USE IN PRODUCTION."
- Service environments are deprecated, and will be removed in the future. DO NOT USE IN PRODUCTION."
`);
expect(diagnostics.renderErrors()).toMatchInlineSnapshot(`
"Processing wrangler configuration:
Expand Down
6 changes: 3 additions & 3 deletions packages/wrangler/src/__tests__/delete.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -516,11 +516,11 @@ function mockDeleteWorkerRequest(
options: {
name?: string;
env?: string;
legacyEnv?: boolean;
enableServiceEnvironments?: boolean;
force?: boolean;
} = {}
) {
const { env, legacyEnv, name } = options;
const { env, enableServiceEnvironments, name } = options;
msw.use(
http.delete(
"*/accounts/:accountId/workers/services/:scriptName",
Expand All @@ -529,7 +529,7 @@ function mockDeleteWorkerRequest(

expect(params.accountId).toEqual("some-account-id");
expect(params.scriptName).toEqual(
legacyEnv && env
!enableServiceEnvironments && env
? `${name ?? "test-name"}-${env}`
: `${name ?? "test-name"}`
);
Expand Down
Loading
Loading