Skip to content

Commit

Permalink
feat: Implement a SimpleCache Class (#548)
Browse files Browse the repository at this point in the history
Co-authored-by: Trevor Elliott <telliott@fastly.com>
  • Loading branch information
JakeChampion and elliottt committed Jun 2, 2023
1 parent 742356f commit 865382d
Show file tree
Hide file tree
Showing 19 changed files with 2,693 additions and 294 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/main.yml
Expand Up @@ -10,7 +10,7 @@ defaults:
run:
shell: bash
env:
viceroy_version: 0.4.4
viceroy_version: 0.5.1
wasm-tools_version: 1.0.28

jobs:
Expand Down Expand Up @@ -128,7 +128,7 @@ jobs:
matrix:
include:
- crate: viceroy
version: 0.4.4 # Note: workflow-level env vars can't be used in matrix definitions
version: 0.5.1 # Note: workflow-level env vars can't be used in matrix definitions
options: ""
- crate: wasm-tools
version: 1.0.28 # Note: workflow-level env vars can't be used in matrix definitions
Expand Down Expand Up @@ -383,6 +383,7 @@ jobs:
- 'byob'
- 'byte-repeater'
- 'cache-override'
- 'cache-simple'
- 'crypto'
- 'edge-dictionary'
- 'error'
Expand Down
28 changes: 28 additions & 0 deletions integration-tests/js-compute/assertions.js
@@ -1,5 +1,33 @@
/* global ReadableStream */

// Testing/Assertion functions //

// TODO: Implement ReadableStream getIterator() and [@@asyncIterator]() methods
export async function streamToString(stream) {
const decoder = new TextDecoder();
let string = '';
let reader = stream.getReader()
// eslint-disable-next-line no-constant-condition
while (true) {
const { done, value } = await reader.read();
if (done) {
return string;
}
string += decoder.decode(value)
}
}

export function iteratableToStream(iterable) {
return new ReadableStream({
async pull(controller) {
for await (const value of iterable) {
controller.enqueue(value);
}
controller.close();
}
});
}

export function pass(message = '') {
return new Response(message)
}
Expand Down

0 comments on commit 865382d

Please sign in to comment.