@@ -4,7 +4,7 @@ exports[`wrangler > kv namespace > create > wrangler.json > should create a name
44"Resource location: remote
55🌀 Creating namespace with title \\ "UnitTestNamespace\\ "
66✨ Success!
7- Add the following to your configuration file in your kv_namespaces array :
7+ To access your new KV Namespace in your Worker, add the following snippet to your configuration file :
88{
99 \\" kv_namespaces\\ " : [
1010 {
@@ -15,11 +15,24 @@ Add the following to your configuration file in your kv_namespaces array:
1515} "
1616` ;
1717
18+ exports [` wrangler > kv namespace > create > wrangler.json > should create a namespace 2` ] = `
19+ "{
20+ \\" compatibility_date\\ " : \\" 2022-01-12\\ " ,
21+ \\" name\\ " : \\" worker\\ " ,
22+ \\" kv_namespaces\\ " : [
23+ {
24+ \\" binding\\ " : \\" UnitTestNamespace\\ " ,
25+ \\" id\\ " : \\" some-namespace-id\\ "
26+ }
27+ ]
28+ } "
29+ ` ;
30+
1831exports [` wrangler > kv namespace > create > wrangler.json > should create a namespace in an environment if configured to do so 1` ] = `
1932"Resource location: remote
2033🌀 Creating namespace with title \\ "customEnv-UnitTestNamespace\\ "
2134✨ Success!
22- Add the following to your configuration file in your kv_namespaces array under [env. customEnv] :
35+ To access your new KV Namespace in your Worker, add the following snippet to your configuration file in the \\ " customEnv\\ " environment :
2336{
2437 \\" kv_namespaces\\ " : [
2538 {
@@ -30,11 +43,57 @@ Add the following to your configuration file in your kv_namespaces array under [
3043} "
3144` ;
3245
46+ exports [` wrangler > kv namespace > create > wrangler.json > should create a namespace in an environment if configured to do so 2` ] = `
47+ "{
48+ \\" compatibility_date\\ " : \\" 2022-01-12\\ " ,
49+ \\" name\\ " : \\" worker\\ " ,
50+ \\" env\\ " : {
51+ \\" customEnv\\ " : {
52+ \\" name\\ " : \\" worker\\ " ,
53+ \\" kv_namespaces\\ " : [
54+ {
55+ \\" binding\\ " : \\" UnitTestNamespace\\ " ,
56+ \\" id\\ " : \\" some-namespace-id\\ "
57+ }
58+ ]
59+ }
60+ }
61+ } "
62+ ` ;
63+
3364exports [` wrangler > kv namespace > create > wrangler.json > should create a namespace using configured worker name 1` ] = `
3465"Resource location: remote
3566🌀 Creating namespace with title \\ "UnitTestNamespace\\ "
3667✨ Success!
37- Add the following to your configuration file in your kv_namespaces array:
68+ To access your new KV Namespace in your Worker, add the following snippet to your configuration file:
69+ {
70+ \\" kv_namespaces\\ " : [
71+ {
72+ \\" binding\\ " : \\" UnitTestNamespace\\ " ,
73+ \\" id\\ " : \\" some-namespace-id\\ "
74+ }
75+ ]
76+ } "
77+ ` ;
78+
79+ exports [` wrangler > kv namespace > create > wrangler.json > should create a namespace using configured worker name 2` ] = `
80+ "{
81+ \\" compatibility_date\\ " : \\" 2022-01-12\\ " ,
82+ \\" name\\ " : \\" other-worker\\ " ,
83+ \\" kv_namespaces\\ " : [
84+ {
85+ \\" binding\\ " : \\" UnitTestNamespace\\ " ,
86+ \\" id\\ " : \\" some-namespace-id\\ "
87+ }
88+ ]
89+ } "
90+ ` ;
91+
92+ exports [` wrangler > kv namespace > create > wrangler.json > should create a namespace with custom binding name 1` ] = `
93+ "Resource location: remote
94+ 🌀 Creating namespace with title \\ "UnitTestNamespace\\ "
95+ ✨ Success!
96+ To access your new KV Namespace in your Worker, add the following snippet to your configuration file:
3897{
3998 \\" kv_namespaces\\ " : [
4099 {
@@ -45,11 +104,24 @@ Add the following to your configuration file in your kv_namespaces array:
45104} "
46105` ;
47106
107+ exports [` wrangler > kv namespace > create > wrangler.json > should create a namespace with custom binding name 2` ] = `
108+ "{
109+ \\" compatibility_date\\ " : \\" 2022-01-12\\ " ,
110+ \\" name\\ " : \\" worker\\ " ,
111+ \\" kv_namespaces\\ " : [
112+ {
113+ \\" binding\\ " : \\" HELLO\\ " ,
114+ \\" id\\ " : \\" some-namespace-id\\ "
115+ }
116+ ]
117+ } "
118+ ` ;
119+
48120exports [` wrangler > kv namespace > create > wrangler.json > should create a preview namespace if configured to do so 1` ] = `
49121"Resource location: remote
50122🌀 Creating namespace with title \\ "UnitTestNamespace_preview\\ "
51123✨ Success!
52- Add the following to your configuration file in your kv_namespaces array :
124+ To access your new KV Namespace in your Worker, add the following snippet to your configuration file :
53125{
54126 \\" kv_namespaces\\ " : [
55127 {
@@ -64,40 +136,78 @@ exports[`wrangler > kv namespace > create > wrangler.toml > should create a name
64136"Resource location: remote
65137🌀 Creating namespace with title \\ "UnitTestNamespace\\ "
66138✨ Success!
67- Add the following to your configuration file in your kv_namespaces array :
139+ To access your new KV Namespace in your Worker, add the following snippet to your configuration file :
68140[[kv_namespaces]]
69141binding = \\ "UnitTestNamespace\\ "
70142id = \\ "some-namespace-id\\ "
71143"
72144` ;
73145
146+ exports [` wrangler > kv namespace > create > wrangler.toml > should create a namespace 2` ] = `
147+ "compatibility_date = \\ "2022-01-12\\ "
148+ name = \\ "worker\\ "
149+ "
150+ ` ;
151+
74152exports [` wrangler > kv namespace > create > wrangler.toml > should create a namespace in an environment if configured to do so 1` ] = `
75153"Resource location: remote
76154🌀 Creating namespace with title \\ "customEnv-UnitTestNamespace\\ "
77155✨ Success!
78- Add the following to your configuration file in your kv_namespaces array under [env. customEnv] :
156+ To access your new KV Namespace in your Worker, add the following snippet to your configuration file in the \\ " customEnv\\ " environment :
79157[[kv_namespaces]]
80158binding = \\ "UnitTestNamespace\\ "
81159id = \\ "some-namespace-id\\ "
82160"
83161` ;
84162
163+ exports [` wrangler > kv namespace > create > wrangler.toml > should create a namespace in an environment if configured to do so 2` ] = `
164+ "compatibility_date = \\ "2022-01-12\\ "
165+ name = \\ "worker\\ "
166+
167+ [env.customEnv]
168+ name = \\ "worker\\ "
169+ "
170+ ` ;
171+
85172exports [` wrangler > kv namespace > create > wrangler.toml > should create a namespace using configured worker name 1` ] = `
86173"Resource location: remote
87174🌀 Creating namespace with title \\ "UnitTestNamespace\\ "
88175✨ Success!
89- Add the following to your configuration file in your kv_namespaces array :
176+ To access your new KV Namespace in your Worker, add the following snippet to your configuration file :
90177[[kv_namespaces]]
91178binding = \\ "UnitTestNamespace\\ "
92179id = \\ "some-namespace-id\\ "
93180"
94181` ;
95182
183+ exports [` wrangler > kv namespace > create > wrangler.toml > should create a namespace using configured worker name 2` ] = `
184+ "compatibility_date = \\ "2022-01-12\\ "
185+ name = \\ "other-worker\\ "
186+ "
187+ ` ;
188+
189+ exports [` wrangler > kv namespace > create > wrangler.toml > should create a namespace with custom binding name 1` ] = `
190+ "Resource location: remote
191+ 🌀 Creating namespace with title \\ "UnitTestNamespace\\ "
192+ ✨ Success!
193+ To access your new KV Namespace in your Worker, add the following snippet to your configuration file:
194+ [[kv_namespaces]]
195+ binding = \\ "UnitTestNamespace\\ "
196+ id = \\ "some-namespace-id\\ "
197+ "
198+ ` ;
199+
200+ exports [` wrangler > kv namespace > create > wrangler.toml > should create a namespace with custom binding name 2` ] = `
201+ "compatibility_date = \\ "2022-01-12\\ "
202+ name = \\ "worker\\ "
203+ "
204+ ` ;
205+
96206exports [` wrangler > kv namespace > create > wrangler.toml > should create a preview namespace if configured to do so 1` ] = `
97207"Resource location: remote
98208🌀 Creating namespace with title \\ "UnitTestNamespace_preview\\ "
99209✨ Success!
100- Add the following to your configuration file in your kv_namespaces array :
210+ To access your new KV Namespace in your Worker, add the following snippet to your configuration file :
101211[[kv_namespaces]]
102212binding = \\ "UnitTestNamespace\\ "
103213preview_id = \\ "some-namespace-id\\ "
0 commit comments