-
Notifications
You must be signed in to change notification settings - Fork 758
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: clean up standard pricing check after legacy usage model depre…
…cation
- Loading branch information
Showing
4 changed files
with
80 additions
and
312 deletions.
There are no files selected for viewing
68 changes: 68 additions & 0 deletions
68
packages/wrangler/src/__tests__/deprecated-usage-model.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import { mockAccountId, mockApiToken } from "./helpers/mock-account-id"; | ||
import { mockConsoleMethods } from "./helpers/mock-console"; | ||
import { mockUploadWorkerRequest } from "./helpers/mock-upload-worker"; | ||
import { mockSubDomainRequest } from "./helpers/mock-workers-subdomain"; | ||
import { | ||
msw, | ||
mswSuccessDeploymentScriptMetadata, | ||
} from "./helpers/msw"; | ||
import { runInTempDir } from "./helpers/run-in-tmp"; | ||
import { runWrangler } from "./helpers/run-wrangler"; | ||
import { writeWorkerSource } from "./helpers/write-worker-source"; | ||
import writeWranglerToml from "./helpers/write-wrangler-toml"; | ||
|
||
describe("deprecated-usage-model", () => { | ||
mockAccountId(); | ||
mockApiToken(); | ||
runInTempDir(); | ||
const std = mockConsoleMethods(); | ||
|
||
// TODO: remove the fake timers and irrelevant tests after March 1st | ||
beforeAll(() => { | ||
jest.useFakeTimers(); | ||
jest.setSystemTime(new Date(2024, 2, 2)); | ||
}); | ||
|
||
afterAll(() => { | ||
jest.useRealTimers(); | ||
}); | ||
|
||
it("should warn user about ignored usage model if usage_model specified", async () => { | ||
msw.use(...mswSuccessDeploymentScriptMetadata); | ||
writeWranglerToml({ usage_model: "bundled" }); | ||
writeWorkerSource(); | ||
mockSubDomainRequest(); | ||
mockUploadWorkerRequest(); | ||
|
||
await runWrangler("deploy ./index"); | ||
|
||
expect(std.warn).toMatchInlineSnapshot(` | ||
"[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mThe \`usage_model\` defined in wrangler.toml is deprecated and no longer used. Visit our developer docs for details: https://developers.cloudflare.com/workers/wrangler/configuration/#usage-model[0m | ||
" | ||
`); | ||
}); | ||
it("should not warn user about ignored usage model if usage_model not specified", async () => { | ||
msw.use(...mswSuccessDeploymentScriptMetadata); | ||
writeWranglerToml(); | ||
writeWorkerSource(); | ||
mockSubDomainRequest(); | ||
mockUploadWorkerRequest(); | ||
|
||
await runWrangler("deploy ./index"); | ||
|
||
expect(std).toMatchInlineSnapshot(` | ||
Object { | ||
"debug": "", | ||
"err": "", | ||
"info": "", | ||
"out": "Total Upload: xx KiB / gzip: xx KiB | ||
Uploaded test-name (TIMINGS) | ||
Published test-name (TIMINGS) | ||
https://test-name.test-sub-domain.workers.dev | ||
Current Deployment ID: Galaxy-Class", | ||
"warn": "", | ||
} | ||
`); | ||
}); | ||
}); |
224 changes: 0 additions & 224 deletions
224
packages/wrangler/src/__tests__/standard-pricing.test.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.