Skip to content

Commit

Permalink
Merge pull request #511 from pmcelhaney/fix-open-handles-in-tests
Browse files Browse the repository at this point in the history
make sure Jest closes all open handles
  • Loading branch information
pmcelhaney committed Aug 21, 2023
2 parents 41a1749 + eb0630b commit 0ae14d3
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 17 deletions.
30 changes: 14 additions & 16 deletions .github/workflows/coveralls.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
2 changes: 2 additions & 0 deletions .rtx.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[tools]
node = "18"
5 changes: 5 additions & 0 deletions test/server/counterfact.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,5 +134,10 @@ describe("integration test", () => {

await moduleLoader.stopWatching();
});

// eslint-disable-next-line promise/avoid-new
await new Promise((resolve) => {
proxyTarget.close(resolve);
});
});
});
5 changes: 4 additions & 1 deletion test/typescript-generator/specification.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down

0 comments on commit 0ae14d3

Please sign in to comment.