48 Commits

Author SHA1 Message Date
Kevin Flansburg
566166f7b2
POC: Leptos with Workers Assets (#640)
* Add assets test and Leptos generate template

* Update readme

* Use production binding name
2024-09-25 11:39:41 -04:00
Kevin Flansburg
bfe6d566ab
Add encodeBody and cf to ResponseInit. Adopt builder pattern. (#568)
* Add `encodeBody` and `cf` to ResponseInit. Adopt builder pattern.

Closes #567

* Refine builder pattern

* address comments

* Response.clone, test, http extensions

* Do not check content-type in Response.json

Closes #577
2024-05-19 08:33:57 -04:00
Kevin Flansburg
70ac998b57
Move KV test suite to worker-sandbox and fix bug in KV put metadata. (#550)
* Move worker-kv test suite to worker-sandbox

* Create explicit struct for KV PutOptions

* Use JSON serializer for KV options
2024-04-19 07:23:26 -04:00
Kevin Flansburg
7fecf35365
Add socket tests (#518)
* Add socket tests

* Fix d1 error again :/
2024-04-01 11:00:57 -04:00
Jonathan Donaldson
cd41d40fbe
Update queue bindings (#335)
* Update queues

* Update queue bindings

* Fix tests and lint

* Fix tests

* Add support for message batches and retry / message options

* Add queue example

* Address comments
2024-03-29 07:19:37 -04:00
Kevin Flansburg
a55205fa6f
Introduce D1PreparedStatement.bind_refs which does not take ownership (#493)
* Introduce D1PreparedStatement.bind_refs which does not take ownership of arguments

* Do not consume prepared statement when binding and batch binding

* Fix D1 tests in CI

* Introduce D1 type enum, support IntoIterator bind arguments

* D1Type Create JsValue on construction

* Another pass on the API ergonomics

* nits / docs

* Tweak batch_bind
2024-03-26 12:48:03 -04:00
Jesse White
c4107bf04b
add tests to cover connecting to durable object via websocket using the hibernatable apis (#495) 2024-03-26 12:06:39 -04:00
Kevin Flansburg
b7068e2747
Duplicate test harness using axum router (#481)
* Prepare to remove global Fetch for http

* clippy

* Refactor worker test harness

* Axum test harness

* Get more tests working

* Macro for marking future as Send

* Remaining axum routes

* More documentation

* Cleanup
2024-03-25 12:06:53 -04:00
Kevin Flansburg
e06193a621
Update all dependencies (#450)
* Update all dependencies

* Fix tests for changes in router param matching
2024-02-26 12:38:22 -05:00
Kevin Flansburg
053e1f8340
Fix timeout test (#445) 2024-02-26 11:24:53 -05:00
Zeb Piasecki
27b28dbf72 chore: fix test suite flaking 2023-10-01 16:19:46 -04:00
Zeb Piasecki
05aa95974e chore: add testing to Storage::put_raw and Storage::put_multiple_raw 2023-08-08 16:23:51 +01:00
Zeb Piasecki
52dbd5186e chore: add d1 tests and d1 specific error type 2023-06-14 12:14:31 -07:00
FlareLine
fff97fe004 Created some initial tests 2023-06-14 12:14:31 -07:00
Zeb Piasecki
7fc81655de chore: switch to miniflare3 using vitest
Updates CI to use miniflare 3 when testing against worker-sandbox using
vitest instead of Cargo's built in test runner.
2023-06-13 09:40:22 -07:00
Zeb Piasecki
c52a11b622 chore: fix CI warnings 2023-05-11 13:49:23 -04:00
Zeb Piasecki
8cd7bf7834 chore: fix ci lints and flaky tests
Clippy added some new lints causing CI to fail so the lints have been
applied and a flaky test has been ignored.
2023-03-13 14:39:47 -04:00
Zeb Piasecki
f70a805319 chore: fix new clippy lints
Recently clippy added a lint requiring the new format syntax, causing
all CI runs to fail.
2023-01-30 12:27:52 -05:00
Jonathan Donaldson
e53ded8d8c Fix lint 2023-01-09 21:23:07 +00:00
Jonathan Donaldson
432db5a493 Merge branch 'main' into queues 2023-01-09 21:15:42 +00:00
Zeb Piasecki
365ac4fd5a suppress deprecated warning for chrono::Date 2023-01-07 13:17:16 -05:00
Zeb Piasecki
e6fd30b4cd feat: R2 support
Adds support for R2 bindings
2023-01-02 14:58:36 -05:00
Zeb Piasecki
c40a2e1792 chore: fix clippy lints
It seems that clippy has introduced new lints that now warn on various
places in the codebase.
2023-01-02 08:59:21 -05:00
Jonathan Donaldson
b8c77f13e9
Update miniflare in CI and fix clippy lints (#2) 2022-12-15 18:57:28 +00:00
Jonathan Donaldson
87a8ad1e99 Add basic tests 2022-12-09 03:27:31 +00:00
Zeb Piasecki
c999534d8f chore: add integration testing for service bindings
Adds integration testing for service bindings by creating a new worker
in the worker-sandbox directory and mounting it with Miniflare.
2022-11-17 10:37:41 -05:00
Zeb Piasecki
6810165620 fix CI 2022-09-13 15:39:35 -04:00
Zeb Piasecki
5b8cd77170 fix: flaky worker-sandbox tests 2022-08-31 09:39:58 -04:00
Zeb Piasecki
47e1343d29 refactor: separate alarm test into it's own DO 2022-08-18 13:43:50 -04:00
Fisher Darling
173819b752 attempt to add an alarm test 2022-08-18 10:02:47 -04:00
Basti Ortiz
77a863cf70
fix: apply necessarily renamed imports 2022-05-19 23:33:55 +08:00
Frank
d9dde13d50 cache_put own response and add tests for caching stream 2022-05-13 11:02:35 -04:00
Frank
3b860a90fc Add cache API endpoints and tests 2022-05-13 10:55:22 -04:00
Zeb Piasecki
9042648b8a feat: add cloned to Response
Adds the ability to clone Responses. As a part of this commit we also
refactor ResponseBody to not include a whole request as part of the
Stream variant. This is a breaking change, but makes a lot more sense.
2022-04-22 13:15:52 -04:00
Zeb Piasecki
4b7de671d0 fix: bug where delays would complete before callback 2022-04-04 12:06:52 -04:00
Zeb Piasecki
fc8e4a8d5f chore: document delay 2022-03-31 16:54:22 -04:00
Zeb Piasecki
3c79875917 feat: implement Delay future
Implements a future called worker::Delay that allows you to wait for a
specified std::time::Duration. This is useful for things like having a
timeout for worker::Fetch requests when combined with a
worker::AbortController.
2022-03-31 16:36:00 -04:00
Zeb Piasecki
cb693f2299 feat: ability to abort fetch requests 2022-03-29 12:40:51 -04:00
Zeb Piasecki
70be95a1e5 feat: ability to add initialization function 2022-02-23 09:19:34 -05:00
Zeb Piasecki
c786c01baa chore: add testing for streaming 2022-02-17 15:12:31 -05:00
Zeb Piasecki
9dc014a506
chore: fix unused function warning (#139)
With the addition of integration testing for websockets we
unintentionally introduced a warning where some functions declared in
the integration test's util module were unused. This is because all
integration tests are compiled as seperate binaries so for the websocket
binary functions weren't used for that specific compile job.

This also adjust flags in the CI to catch warnings like this in the
future.
2022-02-11 10:21:03 -07:00
Zeb Piasecki
fd03338a41
refactor websockets to be more idiomatic (#133)
* refactor: make websocket api more idiomatic

The current WebSocket api is closely modelled after the JavaScript
WebSocket api which is functional but seems like a strange fit inside of
a rust program. This commit refactors the WebSocket api to use
futures::Stream instead of several functions with callbacks.

* chore: fix import

* chore: integration testing for websockets

* refactor: make Websocket's get_data private and add get_json

* refactor: rename MessageEvent methods to be more rusty

* chore: test received close event

* refactor: rename send_with_binary to send_with_bytes

* chore: fix formatting
2022-02-09 14:47:31 -07:00
Zeb Piasecki
46d7cb1da6 chore: fix clippy lints in integration tests 2022-01-31 10:03:38 -05:00
Zeb Piasecki
d9da5dbeb5 chore: fix clippy lints 2022-01-26 14:15:47 -05:00
Zeb Piasecki
efc1afb45d chore: remove cloudflare api test
Removes a route it's test in the sandbox to fix an issue where the CI
would randomly fail or pass. Outbound HTTP requests are still used
within the example worker so the use case is still tested.
2022-01-26 14:09:55 -05:00
Zeb Piasecki
7528258ed9 refactor: rename simple.rs to requests.rs for sandbox tests 2022-01-25 14:48:10 -05:00
Zeb Piasecki
8447f17f7b chore: add tests for all routes and fix actions 2022-01-25 14:40:50 -05:00
Zeb Piasecki
d50ed72c0c feat: begin adding rust integration tests 2022-01-25 14:39:43 -05:00