Skip to content

Commit

Permalink
Test node server
Browse files Browse the repository at this point in the history
Signed-off-by: Timo Stamm <ts@timostamm.de>
  • Loading branch information
timostamm committed Aug 30, 2024
1 parent 7ebb4ea commit ca48a12
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
19 changes: 10 additions & 9 deletions packages/connect-node/conformance/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ import {

main();


process.on("beforeExit", () => {

Check failure on line 44 in packages/connect-node/conformance/server.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected console statement
console.error("connect-node/conformance/server.ts beforeExit", process.pid);
});

process.on("exit", () => {

Check failure on line 48 in packages/connect-node/conformance/server.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected console statement
console.error("connect-node/conformance/server.ts exit", process.pid);
});


/**
* This program implements a server under test for the connect conformance test
* runner. It reads ServerCompatRequest messages from stdin, starts the server
Expand All @@ -56,7 +66,6 @@ function main() {
const req = ServerCompatRequest.fromBinary(
stdinAll.subarray(4),
);
console.error("connect-node/conformance/server.ts compat req", req, process.pid);

const adapter = connectNodeAdapter({
routes,
Expand Down Expand Up @@ -113,14 +122,6 @@ function main() {
throw new Error("Unknown HTTP version");

Check failure on line 122 in packages/connect-node/conformance/server.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected console statement
}

process.on("beforeExit", () => {
console.error("connect-node/conformance/server.ts beforeExit", process.pid);
});

process.on("beforeExit", () => {
console.error("connect-node/conformance/server.ts beforeExit", process.pid);
});

process.on("SIGTERM", () => {
console.error("connect-node/conformance/server.ts SIGTERM", process.pid);
if ("closeAllConnections" in server) {
Expand Down
4 changes: 2 additions & 2 deletions packages/connect-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"build:cjs": "tsc --project tsconfig.build.json --module commonjs --moduleResolution node10 --verbatimModuleSyntax false --outDir ./dist/cjs --declaration --declarationDir ./dist/cjs && echo >./dist/cjs/package.json '{\"type\":\"commonjs\"}'",
"build:esm": "tsc --project tsconfig.build.json --outDir ./dist/esm --declaration --declarationDir ./dist/esm",
"test": "jasmine --config=jasmine.json",
"conformance:server": "tsc --noEmit && connectconformance --mode server --conf ./conformance/conformance-node.yaml -v ./conformance/server.ts",
"conformance:client": "tsc --noEmit && connectconformance --mode client --conf ./conformance/conformance-node.yaml -v ./conformance/client.ts",
"conformance:server": "tsc --noEmit && connectconformance --mode server --conf ./conformance/conformance-node.yaml -v -- npx tsx ./conformance/server.ts",
"conformance:client": "tsc --noEmit && connectconformance --mode client --conf ./conformance/conformance-node.yaml -v -- npx tsx ./conformance/client.ts",
"format": "prettier --write --ignore-unknown '.' '!dist'",
"license-header": "license-header",
"lint": "eslint --max-warnings 0 .",
Expand Down

0 comments on commit ca48a12

Please sign in to comment.