From 4d2b0f86e3b21287904819500e0af16581446863 Mon Sep 17 00:00:00 2001 From: Patrick McElhaney Date: Mon, 21 Aug 2023 14:01:43 -0400 Subject: [PATCH 1/2] make sure Jest closes all open handles --- .rtx.toml | 2 ++ test/server/counterfact.test.js | 5 +++++ test/typescript-generator/specification.test.js | 5 ++++- 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 .rtx.toml diff --git a/.rtx.toml b/.rtx.toml new file mode 100644 index 00000000..7d030b2b --- /dev/null +++ b/.rtx.toml @@ -0,0 +1,2 @@ +[tools] +node = "18" diff --git a/test/server/counterfact.test.js b/test/server/counterfact.test.js index b6cce82b..d75292f8 100644 --- a/test/server/counterfact.test.js +++ b/test/server/counterfact.test.js @@ -134,5 +134,10 @@ describe("integration test", () => { await moduleLoader.stopWatching(); }); + + // eslint-disable-next-line promise/avoid-new + await new Promise((resolve) => { + proxyTarget.close(resolve); + }); }); }); diff --git a/test/typescript-generator/specification.test.js b/test/typescript-generator/specification.test.js index 00263c39..82c04f15 100644 --- a/test/typescript-generator/specification.test.js +++ b/test/typescript-generator/specification.test.js @@ -57,7 +57,10 @@ describe("a Specification", () => { hello: "world", }); - await server.close(); + // eslint-disable-next-line promise/avoid-new + await new Promise((resolve) => { + server.close(resolve); + }); }); it("returns a requirement for a URL", async () => { From eb0630b9e00b3f59f3fad0dfc45c025f5060af93 Mon Sep 17 00:00:00 2001 From: Patrick McElhaney Date: Mon, 21 Aug 2023 14:08:46 -0400 Subject: [PATCH 2/2] remove the --forceExit flag --- .github/workflows/coveralls.yaml | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/.github/workflows/coveralls.yaml b/.github/workflows/coveralls.yaml index e4f6f46c..f37a479c 100644 --- a/.github/workflows/coveralls.yaml +++ b/.github/workflows/coveralls.yaml @@ -3,26 +3,24 @@ on: ["push"] name: Coveralls jobs: - build: name: Coveralls runs-on: ubuntu-latest steps: + - uses: actions/checkout@v3 - - uses: actions/checkout@v3 - - - name: Setup Node.js 16.x - uses: actions/setup-node@v3 - with: - node-version: 16.x - cache: yarn + - name: Setup Node.js 16.x + uses: actions/setup-node@v3 + with: + node-version: 16.x + cache: yarn - - name: install, run tests - run: | - yarn - yarn test --forceExit + - name: install, run tests + run: | + yarn + yarn test - - name: Coveralls - uses: coverallsapp/github-action@v2.2.1 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} + - name: Coveralls + uses: coverallsapp/github-action@v2.2.1 + with: + github-token: ${{ secrets.GITHUB_TOKEN }}