Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
At the minute the tests hang when running on macOS: > Jest did not exit one second after the test run has completed. > > This usually means that there are asynchronous operations that weren't stopped in your tests. Consider running Jest with `--detectOpenHandles` to troubleshoot this issue. If you run `jest —detectOpenHandles` this seems to suggest the issue is with sync-request: ``` Jest has detected the following 1 open handle potentially keeping Jest from exiting: ● PROCESSWRAP at start (node_modules/sync-rpc/lib/index.js:33:13) at sendMessage (node_modules/sync-rpc/lib/index.js:133:17) at createClient (node_modules/sync-rpc/lib/index.js:173:27) at Object.<anonymous> (node_modules/sync-request/lib/index.js:16:14) ``` `sync-request` is only used to fetch the latest version of the kit from the GitHub API. We currently have to do this becuase, although GitHub provides a `/latest/` endpoint to link to the latest release [1], you can only link to assets if you know the asset filename, and the asset filenames are currently based on the version numbers and so not predictable unless you know the latest version number. However, we can avoid calling the API at all by instead using the version number as defined in the package.json file. This allows us to simplify the code and remove the sync-request library entirely. This does rely on the most recent release having been tagged (and thus the release created in GitHub) before the equivalent version is deployed to Heroku. As we have ‘Wait for CI to pass before deploy’ enabled in the Heroku settings I believe this should be the case. [1]: https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/linking-to-releases#:~:text=To%20link%20directly%20to%20a%20download%20of%20your%20latest%20release%20asset%2C%20link%20to%20%2Fowner%2Fname%2Freleases%2Flatest%2Fdownload%2Fasset-name.zip
- Loading branch information