Skip to content

Commit

Permalink
fixup! Implement basic wrangler dev --(experimental-)local E2E tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbbot committed Jan 9, 2023
1 parent ca91a7a commit 5bd46d2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
3 changes: 2 additions & 1 deletion e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"name": "@cloudflare/wrangler-e2e",
"private": true,
"scripts": {
"test": "jest"
"test": "jest",
"check:type": "tsc"
},
"devDependencies": {
"node-gyp": "^9.3.0",
Expand Down
10 changes: 4 additions & 6 deletions e2e/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,10 @@ export class LineSplittingStream extends TransformStream<string, string> {
buffer += chunk;
// Keep looking for lines in `buffer` until we can't find anymore
// eslint-disable-next-line no-constant-condition
while (true) {
// Try to find the next line break (either LF or CRLF)
const nextLineIndex = buffer.indexOf("\n");
// If no line break found in current `buffer`, stop looking and wait
// for more chunks
if (nextLineIndex === -1) break;
let nextLineIndex: number;
// Try to find the next line break (either LF or CRLF), if no line break
// found in current `buffer`, stop looking and wait for more chunks
while ((nextLineIndex = buffer.indexOf("\n")) !== -1) {
// Remove line from `buffer`, and enqueue if non-empty.
// `trim()` handles case of CRLF, by removing CR.
const line = buffer.substring(0, nextLineIndex).trim();
Expand Down
3 changes: 2 additions & 1 deletion e2e/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"compilerOptions": {
"moduleResolution": "node",
"types": ["node", "jest"]
}
},
"include": ["**/*.ts", "**/*.mjs"]
}

0 comments on commit 5bd46d2

Please sign in to comment.