Skip to content
Merged
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
50 changes: 40 additions & 10 deletions packages/wrangler/src/__tests__/__snapshots__/kv.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`wrangler > kv namespace > create > wrangler.json > should create a namespace 1`] = `
"Resource location: remote
"
⛅️ wrangler x.x.x
──────────────────
Resource location: remote
🌀 Creating namespace with title \\"UnitTestNamespace\\"
✨ Success!
To access your new KV Namespace in your Worker, add the following snippet to your configuration file:
Expand Down Expand Up @@ -29,7 +32,10 @@ exports[`wrangler > kv namespace > create > wrangler.json > should create a name
`;

exports[`wrangler > kv namespace > create > wrangler.json > should create a namespace in an environment if configured to do so 1`] = `
"Resource location: remote
"
⛅️ wrangler x.x.x
──────────────────
Resource location: remote
🌀 Creating namespace with title \\"customEnv-UnitTestNamespace\\"
✨ Success!
To access your new KV Namespace in your Worker, add the following snippet to your configuration file in the \\"customEnv\\" environment:
Expand Down Expand Up @@ -63,7 +69,10 @@ exports[`wrangler > kv namespace > create > wrangler.json > should create a name
`;

exports[`wrangler > kv namespace > create > wrangler.json > should create a namespace using configured worker name 1`] = `
"Resource location: remote
"
⛅️ wrangler x.x.x
──────────────────
Resource location: remote
🌀 Creating namespace with title \\"UnitTestNamespace\\"
✨ Success!
To access your new KV Namespace in your Worker, add the following snippet to your configuration file:
Expand Down Expand Up @@ -93,7 +102,10 @@ exports[`wrangler > kv namespace > create > wrangler.json > should create a name
`;

exports[`wrangler > kv namespace > create > wrangler.json > should create a namespace with custom binding name 1`] = `
"Resource location: remote
"
⛅️ wrangler x.x.x
──────────────────
Resource location: remote
🌀 Creating namespace with title \\"UnitTestNamespace\\"
✨ Success!
To access your new KV Namespace in your Worker, add the following snippet to your configuration file:
Expand Down Expand Up @@ -122,7 +134,10 @@ exports[`wrangler > kv namespace > create > wrangler.json > should create a name
`;

exports[`wrangler > kv namespace > create > wrangler.json > should create a preview namespace if configured to do so 1`] = `
"Resource location: remote
"
⛅️ wrangler x.x.x
──────────────────
Resource location: remote
🌀 Creating namespace with title \\"UnitTestNamespace_preview\\"
✨ Success!
To access your new KV Namespace in your Worker, add the following snippet to your configuration file:
Expand All @@ -137,7 +152,10 @@ To access your new KV Namespace in your Worker, add the following snippet to you
`;

exports[`wrangler > kv namespace > create > wrangler.toml > should create a namespace 1`] = `
"Resource location: remote
"
⛅️ wrangler x.x.x
──────────────────
Resource location: remote
🌀 Creating namespace with title \\"UnitTestNamespace\\"
✨ Success!
To access your new KV Namespace in your Worker, add the following snippet to your configuration file:
Expand All @@ -154,7 +172,10 @@ name = \\"worker\\"
`;

exports[`wrangler > kv namespace > create > wrangler.toml > should create a namespace in an environment if configured to do so 1`] = `
"Resource location: remote
"
⛅️ wrangler x.x.x
──────────────────
Resource location: remote
🌀 Creating namespace with title \\"customEnv-UnitTestNamespace\\"
✨ Success!
To access your new KV Namespace in your Worker, add the following snippet to your configuration file in the \\"customEnv\\" environment:
Expand All @@ -174,7 +195,10 @@ name = \\"worker\\"
`;

exports[`wrangler > kv namespace > create > wrangler.toml > should create a namespace using configured worker name 1`] = `
"Resource location: remote
"
⛅️ wrangler x.x.x
──────────────────
Resource location: remote
🌀 Creating namespace with title \\"UnitTestNamespace\\"
✨ Success!
To access your new KV Namespace in your Worker, add the following snippet to your configuration file:
Expand All @@ -192,7 +216,10 @@ name = \\"other-worker\\"
`;

exports[`wrangler > kv namespace > create > wrangler.toml > should create a namespace with custom binding name 1`] = `
"Resource location: remote
"
⛅️ wrangler x.x.x
──────────────────
Resource location: remote
🌀 Creating namespace with title \\"UnitTestNamespace\\"
✨ Success!
To access your new KV Namespace in your Worker, add the following snippet to your configuration file:
Expand All @@ -209,7 +236,10 @@ name = \\"worker\\"
`;

exports[`wrangler > kv namespace > create > wrangler.toml > should create a preview namespace if configured to do so 1`] = `
"Resource location: remote
"
⛅️ wrangler x.x.x
──────────────────
Resource location: remote
🌀 Creating namespace with title \\"UnitTestNamespace_preview\\"
✨ Success!
To access your new KV Namespace in your Worker, add the following snippet to your configuration file:
Expand Down
40 changes: 32 additions & 8 deletions packages/wrangler/src/__tests__/__snapshots__/r2.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`r2 > bucket > create > wrangler.json > should create a bucket & check request inputs 1`] = `
"Creating bucket 'test-bucket'...
"
⛅️ wrangler x.x.x
──────────────────
Creating bucket 'test-bucket'...
✅ Created bucket 'test-bucket' with default storage class of Standard.
To access your new R2 Bucket in your Worker, add the following snippet to your configuration file:
{
Expand All @@ -17,7 +20,10 @@ To access your new R2 Bucket in your Worker, add the following snippet to your c
`;

exports[`r2 > bucket > create > wrangler.json > should create a bucket with the expected default storage class 1`] = `
"Creating bucket 'test-bucket'...
"
⛅️ wrangler x.x.x
──────────────────
Creating bucket 'test-bucket'...
✅ Created bucket 'test-bucket' with default storage class of InfrequentAccess.
To access your new R2 Bucket in your Worker, add the following snippet to your configuration file:
{
Expand All @@ -33,7 +39,10 @@ To access your new R2 Bucket in your Worker, add the following snippet to your c
`;

exports[`r2 > bucket > create > wrangler.json > should create a bucket with the expected jurisdiction 1`] = `
"Creating bucket 'test-bucket (eu)'...
"
⛅️ wrangler x.x.x
──────────────────
Creating bucket 'test-bucket (eu)'...
✅ Created bucket 'test-bucket (eu)' with default storage class of Standard.
To access your new R2 Bucket in your Worker, add the following snippet to your configuration file:
{
Expand All @@ -49,7 +58,10 @@ To access your new R2 Bucket in your Worker, add the following snippet to your c
`;

exports[`r2 > bucket > create > wrangler.json > should create a bucket with the expected location hint 1`] = `
"Creating bucket 'test-bucket'...
"
⛅️ wrangler x.x.x
──────────────────
Creating bucket 'test-bucket'...
✅ Created bucket 'test-bucket' with location hint weur and default storage class of Standard.
To access your new R2 Bucket in your Worker, add the following snippet to your configuration file:
{
Expand All @@ -65,7 +77,10 @@ To access your new R2 Bucket in your Worker, add the following snippet to your c
`;

exports[`r2 > bucket > create > wrangler.toml > should create a bucket & check request inputs 1`] = `
"Creating bucket 'test-bucket'...
"
⛅️ wrangler x.x.x
──────────────────
Creating bucket 'test-bucket'...
✅ Created bucket 'test-bucket' with default storage class of Standard.
To access your new R2 Bucket in your Worker, add the following snippet to your configuration file:
[[r2_buckets]]
Expand All @@ -75,7 +90,10 @@ binding = \\"test_bucket\\"
`;

exports[`r2 > bucket > create > wrangler.toml > should create a bucket with the expected default storage class 1`] = `
"Creating bucket 'test-bucket'...
"
⛅️ wrangler x.x.x
──────────────────
Creating bucket 'test-bucket'...
✅ Created bucket 'test-bucket' with default storage class of InfrequentAccess.
To access your new R2 Bucket in your Worker, add the following snippet to your configuration file:
[[r2_buckets]]
Expand All @@ -85,7 +103,10 @@ binding = \\"test_bucket\\"
`;

exports[`r2 > bucket > create > wrangler.toml > should create a bucket with the expected jurisdiction 1`] = `
"Creating bucket 'test-bucket (eu)'...
"
⛅️ wrangler x.x.x
──────────────────
Creating bucket 'test-bucket (eu)'...
✅ Created bucket 'test-bucket (eu)' with default storage class of Standard.
To access your new R2 Bucket in your Worker, add the following snippet to your configuration file:
[[r2_buckets]]
Expand All @@ -95,7 +116,10 @@ binding = \\"test_bucket\\"
`;

exports[`r2 > bucket > create > wrangler.toml > should create a bucket with the expected location hint 1`] = `
"Creating bucket 'test-bucket'...
"
⛅️ wrangler x.x.x
──────────────────
Creating bucket 'test-bucket'...
✅ Created bucket 'test-bucket' with location hint weur and default storage class of Standard.
To access your new R2 Bucket in your Worker, add the following snippet to your configuration file:
[[r2_buckets]]
Expand Down
20 changes: 16 additions & 4 deletions packages/wrangler/src/__tests__/ai.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ describe("ai commands", () => {
mockAIListFinetuneRequest();
await runWrangler("ai finetune list");
expect(std.out).toMatchInlineSnapshot(`
"┌─┬─┬─┐
"
⛅️ wrangler x.x.x
──────────────────
┌─┬─┬─┐
│ finetune_id │ name │ description │
├─┼─┼─┤
│ 4d73459a-0000-4688-0000-b19fbb0e0fa5 │ instruct-demo1 │ │
Expand All @@ -108,7 +111,10 @@ describe("ai commands", () => {
mockAISearchRequest();
await runWrangler("ai models");
expect(std.out).toMatchInlineSnapshot(`
"┌─┬─┬─┬─┐
"
⛅️ wrangler x.x.x
──────────────────
┌─┬─┬─┬─┐
│ model │ name │ description │ task │
├─┼─┼─┼─┤
│ 429b9e8b-d99e-44de-91ad-706cf8183658 │ @cloudflare/embeddings_bge_large_en │ │ │
Expand All @@ -126,7 +132,10 @@ describe("ai commands", () => {
mockAIOverflowRequest();
await runWrangler("ai models");
expect(std.out).toMatchInlineSnapshot(`
"┌─┬─┬─┬─┐
"
⛅️ wrangler x.x.x
──────────────────
┌─┬─┬─┬─┐
│ model │ name │ description │ task │
├─┼─┼─┼─┤
│ 429b9e8b-d99e-44de-91ad-706cf8183658 │ @cloudflare/embeddings_bge_large_en │ │ │
Expand All @@ -144,7 +153,10 @@ describe("ai commands", () => {
mockAIPaginatedRequest();
await runWrangler("ai models");
expect(std.out).toMatchInlineSnapshot(`
"┌─┬─┬─┬─┐
"
⛅️ wrangler x.x.x
──────────────────
┌─┬─┬─┬─┐
│ model │ name │ description │ task │
├─┼─┼─┼─┤
│ 429b9e8b-d99e-44de-91ad-706cf8183658 │ @cloudflare/embeddings_bge_large_en │ │ │
Expand Down
Loading
Loading