You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`kv bulk get --remote --namespace-id some-namespace-id keys.json`
1929
+
);
1930
+
expect(requests.count).toEqual(1);
1931
+
expect(std.out).toMatchInlineSnapshot(`
1932
+
"{
1933
+
\\"someKey1\\": \\"someKey1-value\\",
1934
+
\\"key2\\": \\"key2-value\\"
1935
+
}
1936
+
1937
+
Success!"
1938
+
`);
1939
+
expect(std.warn).toMatchInlineSnapshot(`
1940
+
"[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1m🚧 \`wrangler kv bulk get\` is an open-beta command. Please report any issues to https://github.com/cloudflare/workers-sdk/issues/new/choose[0m
1941
+
1942
+
"
1943
+
`);
1944
+
expect(std.err).toMatchInlineSnapshot(`""`);
1945
+
});
1946
+
1947
+
it("should get the keys parsed from a file ({ name })",async()=>{
`kv bulk get --remote --namespace-id some-namespace-id keys.json`
1956
+
);
1957
+
expect(requests.count).toEqual(1);
1958
+
expect(std.out).toMatchInlineSnapshot(`
1959
+
"{
1960
+
\\"someKey1\\": \\"someKey1-value\\",
1961
+
\\"ns:someKey2\\": \\"ns:someKey2-value\\"
1962
+
}
1963
+
1964
+
Success!"
1965
+
`);
1966
+
expect(std.warn).toMatchInlineSnapshot(`
1967
+
"[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1m🚧 \`wrangler kv bulk get\` is an open-beta command. Please report any issues to https://github.com/cloudflare/workers-sdk/issues/new/choose[0m
1968
+
1969
+
"
1970
+
`);
1971
+
expect(std.err).toMatchInlineSnapshot(`""`);
1972
+
});
1973
+
1974
+
it("should error if the file is not a JSON array",async()=>{
`kv bulk get --remote --namespace-id some-namespace-id keys.json`
1980
+
)
1981
+
).rejects.toThrowErrorMatchingInlineSnapshot(`
1982
+
[Error: Unexpected JSON input from "keys.json".
1983
+
Expected an array of strings but got:
1984
+
12354]
1985
+
`);
1986
+
expect(std.out).toMatchInlineSnapshot(`""`);
1987
+
expect(std.warn).toMatchInlineSnapshot(`
1988
+
"[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1m🚧 \`wrangler kv bulk get\` is an open-beta command. Please report any issues to https://github.com/cloudflare/workers-sdk/issues/new/choose[0m
1989
+
1990
+
"
1991
+
`);
1992
+
});
1993
+
1994
+
it("should error if the file contains non-string items",async()=>{
`kv bulk get --remote --namespace-id some-namespace-id keys.json`
2000
+
)
2001
+
).rejects.toThrowErrorMatchingInlineSnapshot(`
2002
+
[Error: Unexpected JSON input from "keys.json".
2003
+
Expected an array of strings or objects with a "name" key.
2004
+
The item at index 1 is type: "number" - 12354
2005
+
The item at index 2 is type: "object" - {"key":"someKey"}
2006
+
The item at index 3 is type: "object" - null]
2007
+
`);
2008
+
expect(std.out).toMatchInlineSnapshot(`""`);
2009
+
expect(std.warn).toMatchInlineSnapshot(`
2010
+
"[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1m🚧 \`wrangler kv bulk get\` is an open-beta command. Please report any issues to https://github.com/cloudflare/workers-sdk/issues/new/choose[0m
0 commit comments