diff --git a/CHANGELOG.md b/CHANGELOG.md index 2780d9cd..8a0359c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,282 +2,290 @@ All notable changes to this project will be documented in this file. -The format is based on [Conventional Commits][42], and this project adheres to -[Semantic Versioning][43]. +The format is based on [Conventional Commits][64], and this project adheres to +[Semantic Versioning][65]. -## [1.2.13][44] (2021-02-05) +## [1.2.14][66] (2021-02-08) ### Bug Fixes -- **config:** use transform-rename-import when building externals - ([d224f5e][45]) -- **index.ts:** use NextApiHandler type (thanks [@janhesters][46]) - ([473ff50][47]) -- **integration-webpack.test.ts:** actually call bundle in test ([f7a12de][48]) -- **is-next-compat.ts:** better handling of generics ([d7bc091][49]) -- Next no longer misclassified as CJS ([9ebac01][50]) +- **readme.md:** add Apollo example and additional guidance ([ed357f5][67]) + +## [1.2.13][1] (2021-02-05) + +### Bug Fixes + +- **config:** use transform-rename-import when building externals ([d224f5e][2]) +- **index.ts:** use NextApiHandler type (thanks [@janhesters][3]) ([473ff50][4]) +- **integration-webpack.test.ts:** actually call bundle in test ([f7a12de][5]) +- **is-next-compat.ts:** better handling of generics ([d7bc091][6]) +- Next no longer misclassified as CJS ([9ebac01][7]) ### Build System -- Properly mocked unit tests for externals ([b3273df][51]) -- **build-test-deploy.yml:** drop support for webpack 4 ([e508c06][52]) -- **test:** improved testing infrastructure ([fffe02e][53]) -- Only silence sjx if not DEBUG ([f01ce40][54]) -- **build-test-deploy.yml:** drop support for node 10 ([6adde15][55]) -- **build-test-deploy.yml:** remove externals exception ([5e3893a][56]) -- **cleanup.yml:** fix bugs in workflow ([cbf22fd][57]) -- **package.json:** improved build-dist ([a3526f2][58]) -- **package.json:** nicer destructured vals in docs ([661e62d][59]) -- **package.json:** remove extraneous module ([1f2ad6a][60]) -- **package.json:** update dependencies ([c64f761][61]) -- **post-release-check.yml:** add five-minute-sleep ([4a0552d][62]) -- **post-release-check.yml:** more resilient post-release check ([856435f][63]) -- **types:** more precise unique-filename type ([a60793c][64]) -- Drop support for node 10 ([71e9103][65]) - -## [1.2.12][1] (2021-01-23) +- Properly mocked unit tests for externals ([b3273df][8]) +- **build-test-deploy.yml:** drop support for webpack 4 ([e508c06][9]) +- **test:** improved testing infrastructure ([fffe02e][10]) +- Only silence sjx if not DEBUG ([f01ce40][11]) +- **build-test-deploy.yml:** drop support for node 10 ([6adde15][12]) +- **build-test-deploy.yml:** remove externals exception ([5e3893a][13]) +- **cleanup.yml:** fix bugs in workflow ([cbf22fd][14]) +- **package.json:** improved build-dist ([a3526f2][15]) +- **package.json:** nicer destructured vals in docs ([661e62d][16]) +- **package.json:** remove extraneous module ([1f2ad6a][17]) +- **package.json:** update dependencies ([c64f761][18]) +- **post-release-check.yml:** add five-minute-sleep ([4a0552d][19]) +- **post-release-check.yml:** more resilient post-release check ([856435f][20]) +- **types:** more precise unique-filename type ([a60793c][21]) +- Drop support for node 10 ([71e9103][22]) + +## [1.2.12][23] (2021-01-23) ### Build System -- Remove erroneous module import ([6eb2a34][2]) +- Remove erroneous module import ([6eb2a34][24]) -## [1.2.11][3] (2021-01-23) +## [1.2.11][25] (2021-01-23) ### Build System -- Backport/normalize across packages ([e589c1d][4]) +- Backport/normalize across packages ([e589c1d][26]) -## [1.2.10][5] (2021-01-22) +## [1.2.10][27] (2021-01-22) ### Build System -- Update debug statement syntax ([52a2276][6]) +- Update debug statement syntax ([52a2276][28]) -## [1.2.9][7] (2021-01-21) +## [1.2.9][29] (2021-01-21) ### Build System - **.github/workflows/build-test-deploy.yml:** fix peer dependency installation - ([12e5bbe][8]) + ([12e5bbe][30]) -## [1.2.8][9] (2021-01-13) +## [1.2.8][31] (2021-01-13) ### Bug Fixes -- **readme.md:** ensure quick start example is functional ([87dc31f][10]) +- **readme.md:** ensure quick start example is functional ([87dc31f][32]) -## [1.2.7][11] (2021-01-12) +## [1.2.7][33] (2021-01-12) ### Build System -- Rebuild lockfile ([94cfa38][12]) -- Update babel-plugin-transform-mjs-imports ([62089c7][13]) +- Rebuild lockfile ([94cfa38][34]) +- Update babel-plugin-transform-mjs-imports ([62089c7][35]) -## [1.2.6][14] (2021-01-06) +## [1.2.6][36] (2021-01-06) ### Build System -- **package.json:** prune old deps ([2cf1d29][15]) +- **package.json:** prune old deps ([2cf1d29][37]) -## [1.2.5][16] (2021-01-06) +## [1.2.5][38] (2021-01-06) ### Build System -- **.github:** add is-next-compat workflow ([1823c05][17]) +- **.github:** add is-next-compat workflow ([1823c05][39]) - **.github/workflows/post-release-check.yml:** add new post-release-check - ([a307efc][18]) + ([a307efc][40]) -## [1.2.4][19] (2021-01-06) +## [1.2.4][41] (2021-01-06) ### Build System -- **readme.md:** add quick start example ([4e5e12c][20]) +- **readme.md:** add quick start example ([4e5e12c][42]) -## [1.2.3][21] (2021-01-05) +## [1.2.3][43] (2021-01-05) ### Build System - **package.json:** favor "prepare" over "postinstall" and use npx for dev tools - ([a111c87][22]) + ([a111c87][44]) -## [1.2.2][23] (2021-01-05) +## [1.2.2][45] (2021-01-05) ### Build System -- **readme.md:** cosmetic ([98b65c6][24]) +- **readme.md:** cosmetic ([98b65c6][46]) -## [1.2.1][25] (2021-01-05) +## [1.2.1][47] (2021-01-05) ### Build System - **package.json:** update dependencies, prune unused dependencies - ([6ef6cbe][26]) + ([6ef6cbe][48]) -# [1.2.0][27] (2021-01-05) +# [1.2.0][49] (2021-01-05) ### Build System -- **deps:** bump node-notifier from 8.0.0 to 8.0.1 ([45a79d4][28]) +- **deps:** bump node-notifier from 8.0.0 to 8.0.1 ([45a79d4][50]) - **test/unit-externals.test.ts:** add mongo uri env var to test explicitly - ([e0e1fd9][29]) + ([e0e1fd9][51]) ### Features - **.changelogrc.js:** transfer repository over to semantic-release CI/CD - ([b9d2bf0][30]) + ([b9d2bf0][52]) -## [1.1.3][31] (2020-12-06) +## [1.1.3][53] (2020-12-06) ### Build System -- **package.json:** audit and update deps ([c82695a][32]) -- **package.json:** manually bump version ([813b21a][33]) +- **package.json:** audit and update deps ([c82695a][54]) +- **package.json:** manually bump version ([813b21a][55]) -## [1.1.2][34] (2020-11-26) +## [1.1.2][56] (2020-11-26) ### Bug Fixes -- **README:** update install language ([b68c721][35]) +- **README:** update install language ([b68c721][57]) -## [1.1.1][36] (2020-11-26) +## [1.1.1][58] (2020-11-26) ### Bug Fixes -- **externals:** revert sort-package-json to maintainer version ([750055b][37]) -- **externals:** rewrite test workflow ([d604dfc][38]) +- **externals:** revert sort-package-json to maintainer version ([750055b][59]) +- **externals:** rewrite test workflow ([d604dfc][60]) -# [1.1.0][39] (2020-11-25) +# [1.1.0][61] (2020-11-25) ### Bug Fixes -- **build:** move Next.js dependency to peer/dev dependencies ([0e7541f][40]) +- **build:** move Next.js dependency to peer/dev dependencies ([0e7541f][62]) - **externals:** updated remaining dependency references to peerDependency - references ([ccf54fb][41]) + references ([ccf54fb][63]) [1]: - https://github.com/Xunnamius/next-test-api-route-handler/compare/v1.2.11...v1.2.12 + https://github.com/Xunnamius/next-test-api-route-handler/compare/v1.2.12...v1.2.13 [2]: - https://github.com/Xunnamius/next-test-api-route-handler/commit/6eb2a348b1352e9f30d7ecacbaba01fa11cf1cfe -[3]: - https://github.com/Xunnamius/next-test-api-route-handler/compare/v1.2.10...v1.2.11 + https://github.com/Xunnamius/next-test-api-route-handler/commit/d224f5eff5a786b96614b2c3f826eba610027da0 +[3]: https://github.com/janhesters [4]: - https://github.com/Xunnamius/next-test-api-route-handler/commit/e589c1d48aa1dae40643385c6acfcbacf9b40e16 + https://github.com/Xunnamius/next-test-api-route-handler/commit/473ff500fb2c954ce32be911bde943259ae1bbef [5]: - https://github.com/Xunnamius/next-test-api-route-handler/compare/v1.2.9...v1.2.10 + https://github.com/Xunnamius/next-test-api-route-handler/commit/f7a12ded8f43359fd3079ea8294a2199c34b2d26 [6]: - https://github.com/Xunnamius/next-test-api-route-handler/commit/52a22765e17759271e7ba6c83ce9f3609500b5f3 + https://github.com/Xunnamius/next-test-api-route-handler/commit/d7bc091fe8f8e85b70987cfa4c663c7c8fd018c8 [7]: - https://github.com/Xunnamius/next-test-api-route-handler/compare/v1.2.8...v1.2.9 + https://github.com/Xunnamius/next-test-api-route-handler/commit/9ebac018798ac82b97b8163bc5713b43001f592c [8]: - https://github.com/Xunnamius/next-test-api-route-handler/commit/12e5bbe1bf36fda3ef938c7ed7cd445fec3901c9 + https://github.com/Xunnamius/next-test-api-route-handler/commit/b3273dfbe43cb4c9ececdb4863ff4259f38807ec [9]: - https://github.com/Xunnamius/next-test-api-route-handler/compare/v1.2.7...v1.2.8 + https://github.com/Xunnamius/next-test-api-route-handler/commit/e508c06b77d225f150ebfce6409c2506a88efe4c [10]: - https://github.com/Xunnamius/next-test-api-route-handler/commit/87dc31f264682d8048ee8d4cba4dbf866666bf07 + https://github.com/Xunnamius/next-test-api-route-handler/commit/fffe02e14615daba1f9f8ec1bb2a4024ceb93e84 [11]: - https://github.com/Xunnamius/next-test-api-route-handler/compare/v1.2.6...v1.2.7 + https://github.com/Xunnamius/next-test-api-route-handler/commit/f01ce4041b2fb1fd24052ce17008df9746652730 [12]: - https://github.com/Xunnamius/next-test-api-route-handler/commit/94cfa3806bfa0250e9b2dd5b3abfb2ff65c77c6a + https://github.com/Xunnamius/next-test-api-route-handler/commit/6adde1576f4aeb8b9a72cdcefc2ea6bd4b71a5cd [13]: - https://github.com/Xunnamius/next-test-api-route-handler/commit/62089c79f6c9b585d2bb8ca0a8b87bd355b8695f + https://github.com/Xunnamius/next-test-api-route-handler/commit/5e3893a425b95ac2b12edc2195171de85afcfd0a [14]: - https://github.com/Xunnamius/next-test-api-route-handler/compare/v1.2.5...v1.2.6 + https://github.com/Xunnamius/next-test-api-route-handler/commit/cbf22fdd78e28e02ec4213156c6c72ba16c8bfa3 [15]: - https://github.com/Xunnamius/next-test-api-route-handler/commit/2cf1d29159fb746dc4a7c09a8193e46c6bec3823 + https://github.com/Xunnamius/next-test-api-route-handler/commit/a3526f28057201fcce19c752e554e705b8e3a922 [16]: - https://github.com/Xunnamius/next-test-api-route-handler/compare/v1.2.4...v1.2.5 + https://github.com/Xunnamius/next-test-api-route-handler/commit/661e62d53be74211d3d158ad90c196f43c8fe6db [17]: - https://github.com/Xunnamius/next-test-api-route-handler/commit/1823c055f034e528337c68d710164097e423f6e2 + https://github.com/Xunnamius/next-test-api-route-handler/commit/1f2ad6a2cdc863b183ac7f7bef756dd90c057ebe [18]: - https://github.com/Xunnamius/next-test-api-route-handler/commit/a307efcf2cdf60679d68fab385bdc8951a476ace + https://github.com/Xunnamius/next-test-api-route-handler/commit/c64f761c3b2cc69cf07cd7dd88e9671deb66fc4f [19]: - https://github.com/Xunnamius/next-test-api-route-handler/compare/v1.2.3...v1.2.4 + https://github.com/Xunnamius/next-test-api-route-handler/commit/4a0552d2c730842371325111276c58651dabc558 [20]: - https://github.com/Xunnamius/next-test-api-route-handler/commit/4e5e12c0df4fc80abb696d32718440ff294902e7 + https://github.com/Xunnamius/next-test-api-route-handler/commit/856435f02ebe2f44b13c92cc6c794eeab2b345d0 [21]: - https://github.com/Xunnamius/next-test-api-route-handler/compare/v1.2.2...v1.2.3 + https://github.com/Xunnamius/next-test-api-route-handler/commit/a60793c620fe926308f8c99c61076da81aebe2fa [22]: - https://github.com/Xunnamius/next-test-api-route-handler/commit/a111c87ccd863ce4dac85a5bd0281d87affe3b63 + https://github.com/Xunnamius/next-test-api-route-handler/commit/71e9103df5660fea2af3211b1d6c1fa72b1dd3c7 [23]: - https://github.com/Xunnamius/next-test-api-route-handler/compare/v1.2.1...v1.2.2 + https://github.com/Xunnamius/next-test-api-route-handler/compare/v1.2.11...v1.2.12 [24]: - https://github.com/Xunnamius/next-test-api-route-handler/commit/98b65c6da330040e4bcbc22fe28db87c3965fd0e + https://github.com/Xunnamius/next-test-api-route-handler/commit/6eb2a348b1352e9f30d7ecacbaba01fa11cf1cfe [25]: - https://github.com/Xunnamius/next-test-api-route-handler/compare/v1.2.0...v1.2.1 + https://github.com/Xunnamius/next-test-api-route-handler/compare/v1.2.10...v1.2.11 [26]: - https://github.com/Xunnamius/next-test-api-route-handler/commit/6ef6cbeb143648eb1fed5eff39071a06e7354275 + https://github.com/Xunnamius/next-test-api-route-handler/commit/e589c1d48aa1dae40643385c6acfcbacf9b40e16 [27]: - https://github.com/Xunnamius/next-test-api-route-handler/compare/v1.1.3...v1.2.0 + https://github.com/Xunnamius/next-test-api-route-handler/compare/v1.2.9...v1.2.10 [28]: - https://github.com/Xunnamius/next-test-api-route-handler/commit/45a79d41835b5146912511f8b583c9128d154cf9 + https://github.com/Xunnamius/next-test-api-route-handler/commit/52a22765e17759271e7ba6c83ce9f3609500b5f3 [29]: - https://github.com/Xunnamius/next-test-api-route-handler/commit/e0e1fd951fbe63c04c264ad11ab1fa7a39e1679a + https://github.com/Xunnamius/next-test-api-route-handler/compare/v1.2.8...v1.2.9 [30]: - https://github.com/Xunnamius/next-test-api-route-handler/commit/b9d2bf010fba4b163e1eea0801271292a0e74308 + https://github.com/Xunnamius/next-test-api-route-handler/commit/12e5bbe1bf36fda3ef938c7ed7cd445fec3901c9 [31]: - https://github.com/Xunnamius/next-test-api-route-handler/compare/v1.1.2...v1.1.3 + https://github.com/Xunnamius/next-test-api-route-handler/compare/v1.2.7...v1.2.8 [32]: - https://github.com/Xunnamius/next-test-api-route-handler/commit/c82695a8816b6cd5f0e11d09cc2f948a30a416e9 + https://github.com/Xunnamius/next-test-api-route-handler/commit/87dc31f264682d8048ee8d4cba4dbf866666bf07 [33]: - https://github.com/Xunnamius/next-test-api-route-handler/commit/813b21ad1e2c78594903b3a8f504f4460d8e506e + https://github.com/Xunnamius/next-test-api-route-handler/compare/v1.2.6...v1.2.7 [34]: - https://github.com/Xunnamius/next-test-api-route-handler/compare/v1.1.1...v1.1.2 + https://github.com/Xunnamius/next-test-api-route-handler/commit/94cfa3806bfa0250e9b2dd5b3abfb2ff65c77c6a [35]: - https://github.com/Xunnamius/next-test-api-route-handler/commit/b68c721e5100baa883c7096e5cc4e81c1c60ed00 + https://github.com/Xunnamius/next-test-api-route-handler/commit/62089c79f6c9b585d2bb8ca0a8b87bd355b8695f [36]: - https://github.com/Xunnamius/next-test-api-route-handler/compare/v1.1.0...v1.1.1 + https://github.com/Xunnamius/next-test-api-route-handler/compare/v1.2.5...v1.2.6 [37]: - https://github.com/Xunnamius/next-test-api-route-handler/commit/750055b92699fc7f1c06349ccdb0ddc0179f891a + https://github.com/Xunnamius/next-test-api-route-handler/commit/2cf1d29159fb746dc4a7c09a8193e46c6bec3823 [38]: - https://github.com/Xunnamius/next-test-api-route-handler/commit/d604dfc39d2e77cbe1234b8349a2ecef81a9e54a + https://github.com/Xunnamius/next-test-api-route-handler/compare/v1.2.4...v1.2.5 [39]: - https://github.com/Xunnamius/next-test-api-route-handler/compare/v1.0.10...v1.1.0 + https://github.com/Xunnamius/next-test-api-route-handler/commit/1823c055f034e528337c68d710164097e423f6e2 [40]: - https://github.com/Xunnamius/next-test-api-route-handler/commit/0e7541fbecd2e3bacc124f624bfca2b56ceeb89f + https://github.com/Xunnamius/next-test-api-route-handler/commit/a307efcf2cdf60679d68fab385bdc8951a476ace [41]: - https://github.com/Xunnamius/next-test-api-route-handler/commit/ccf54fb480e35961647900d345149d3cd1cf60d8 -[42]: https://conventionalcommits.org -[43]: https://semver.org + https://github.com/Xunnamius/next-test-api-route-handler/compare/v1.2.3...v1.2.4 +[42]: + https://github.com/Xunnamius/next-test-api-route-handler/commit/4e5e12c0df4fc80abb696d32718440ff294902e7 +[43]: + https://github.com/Xunnamius/next-test-api-route-handler/compare/v1.2.2...v1.2.3 [44]: - https://github.com/Xunnamius/next-test-api-route-handler/compare/v1.2.12...v1.2.13 + https://github.com/Xunnamius/next-test-api-route-handler/commit/a111c87ccd863ce4dac85a5bd0281d87affe3b63 [45]: - https://github.com/Xunnamius/next-test-api-route-handler/commit/d224f5eff5a786b96614b2c3f826eba610027da0 -[46]: https://github.com/janhesters + https://github.com/Xunnamius/next-test-api-route-handler/compare/v1.2.1...v1.2.2 +[46]: + https://github.com/Xunnamius/next-test-api-route-handler/commit/98b65c6da330040e4bcbc22fe28db87c3965fd0e [47]: - https://github.com/Xunnamius/next-test-api-route-handler/commit/473ff500fb2c954ce32be911bde943259ae1bbef + https://github.com/Xunnamius/next-test-api-route-handler/compare/v1.2.0...v1.2.1 [48]: - https://github.com/Xunnamius/next-test-api-route-handler/commit/f7a12ded8f43359fd3079ea8294a2199c34b2d26 + https://github.com/Xunnamius/next-test-api-route-handler/commit/6ef6cbeb143648eb1fed5eff39071a06e7354275 [49]: - https://github.com/Xunnamius/next-test-api-route-handler/commit/d7bc091fe8f8e85b70987cfa4c663c7c8fd018c8 + https://github.com/Xunnamius/next-test-api-route-handler/compare/v1.1.3...v1.2.0 [50]: - https://github.com/Xunnamius/next-test-api-route-handler/commit/9ebac018798ac82b97b8163bc5713b43001f592c + https://github.com/Xunnamius/next-test-api-route-handler/commit/45a79d41835b5146912511f8b583c9128d154cf9 [51]: - https://github.com/Xunnamius/next-test-api-route-handler/commit/b3273dfbe43cb4c9ececdb4863ff4259f38807ec + https://github.com/Xunnamius/next-test-api-route-handler/commit/e0e1fd951fbe63c04c264ad11ab1fa7a39e1679a [52]: - https://github.com/Xunnamius/next-test-api-route-handler/commit/e508c06b77d225f150ebfce6409c2506a88efe4c + https://github.com/Xunnamius/next-test-api-route-handler/commit/b9d2bf010fba4b163e1eea0801271292a0e74308 [53]: - https://github.com/Xunnamius/next-test-api-route-handler/commit/fffe02e14615daba1f9f8ec1bb2a4024ceb93e84 + https://github.com/Xunnamius/next-test-api-route-handler/compare/v1.1.2...v1.1.3 [54]: - https://github.com/Xunnamius/next-test-api-route-handler/commit/f01ce4041b2fb1fd24052ce17008df9746652730 + https://github.com/Xunnamius/next-test-api-route-handler/commit/c82695a8816b6cd5f0e11d09cc2f948a30a416e9 [55]: - https://github.com/Xunnamius/next-test-api-route-handler/commit/6adde1576f4aeb8b9a72cdcefc2ea6bd4b71a5cd + https://github.com/Xunnamius/next-test-api-route-handler/commit/813b21ad1e2c78594903b3a8f504f4460d8e506e [56]: - https://github.com/Xunnamius/next-test-api-route-handler/commit/5e3893a425b95ac2b12edc2195171de85afcfd0a + https://github.com/Xunnamius/next-test-api-route-handler/compare/v1.1.1...v1.1.2 [57]: - https://github.com/Xunnamius/next-test-api-route-handler/commit/cbf22fdd78e28e02ec4213156c6c72ba16c8bfa3 + https://github.com/Xunnamius/next-test-api-route-handler/commit/b68c721e5100baa883c7096e5cc4e81c1c60ed00 [58]: - https://github.com/Xunnamius/next-test-api-route-handler/commit/a3526f28057201fcce19c752e554e705b8e3a922 + https://github.com/Xunnamius/next-test-api-route-handler/compare/v1.1.0...v1.1.1 [59]: - https://github.com/Xunnamius/next-test-api-route-handler/commit/661e62d53be74211d3d158ad90c196f43c8fe6db + https://github.com/Xunnamius/next-test-api-route-handler/commit/750055b92699fc7f1c06349ccdb0ddc0179f891a [60]: - https://github.com/Xunnamius/next-test-api-route-handler/commit/1f2ad6a2cdc863b183ac7f7bef756dd90c057ebe + https://github.com/Xunnamius/next-test-api-route-handler/commit/d604dfc39d2e77cbe1234b8349a2ecef81a9e54a [61]: - https://github.com/Xunnamius/next-test-api-route-handler/commit/c64f761c3b2cc69cf07cd7dd88e9671deb66fc4f + https://github.com/Xunnamius/next-test-api-route-handler/compare/v1.0.10...v1.1.0 [62]: - https://github.com/Xunnamius/next-test-api-route-handler/commit/4a0552d2c730842371325111276c58651dabc558 + https://github.com/Xunnamius/next-test-api-route-handler/commit/0e7541fbecd2e3bacc124f624bfca2b56ceeb89f [63]: - https://github.com/Xunnamius/next-test-api-route-handler/commit/856435f02ebe2f44b13c92cc6c794eeab2b345d0 -[64]: - https://github.com/Xunnamius/next-test-api-route-handler/commit/a60793c620fe926308f8c99c61076da81aebe2fa -[65]: - https://github.com/Xunnamius/next-test-api-route-handler/commit/71e9103df5660fea2af3211b1d6c1fa72b1dd3c7 + https://github.com/Xunnamius/next-test-api-route-handler/commit/ccf54fb480e35961647900d345149d3cd1cf60d8 +[64]: https://conventionalcommits.org +[65]: https://semver.org +[66]: + https://github.com/Xunnamius/next-test-api-route-handler/compare/v1.2.13...v1.2.14 +[67]: + https://github.com/Xunnamius/next-test-api-route-handler/commit/ed357f5211a49bfffbb28f03d60f157fa23d14b4 diff --git a/docs/README.md b/docs/README.md index 820c4189..cd6ca78c 100644 --- a/docs/README.md +++ b/docs/README.md @@ -2,29 +2,32 @@ ### Functions -* [testApiHandler][1] +- [testApiHandler][1] ## Functions ### testApiHandler -▸ **testApiHandler**({ `handler`: NextApiHandler ; `params?`: *Record*<*string*, *unknown*> ; `requestPatcher?`: (`req`: IncomingMessage) => *void* ; `responsePatcher?`: (`res`: ServerResponse) => *void* ; `test`: (`obj`: { `fetch`: (`init?`: RequestInit) => *ReturnType*<*typeof* fetch> }) => *Promise*<*void*> }): *Promise*<*void*> +▸ **testApiHandler**({ `handler`: NextApiHandler ; `params?`: _Record_<_string_, +_unknown_> ; `requestPatcher?`: (`req`: IncomingMessage) => _void_ ; +`responsePatcher?`: (`res`: ServerResponse) => _void_ ; `test`: (`obj`: { +`fetch`: (`init?`: RequestInit) => _ReturnType_<_typeof_ fetch> }) => +_Promise_<_void_> }): _Promise_<_void_> -Uses Next's internal `apiResolver` to execute api route handlers in a -Next-like testing environment. +Uses Next's internal `apiResolver` to execute api route handlers in a Next-like +testing environment. -`requestPatcher/responsePatcher` are functions that receive an -IncomingMessage and ServerResponse object respectively. Use these functions -to edit the request and response before they're injected into the api -handler. +`requestPatcher/responsePatcher` are functions that receive an IncomingMessage +and ServerResponse object respectively. Use these functions to edit the request +and response before they're injected into the api handler. -`params` are passed directly to the api handler and represent processed -dynamic routes. This should not be confused with query string parsing, which -is handled automatically. +`params` are passed directly to the api handler and represent processed dynamic +routes. This should not be confused with query string parsing, which is handled +automatically. -`handler` is the actual api handler under test. It should be an async -function that accepts NextApiRequest and NextApiResult objects (in that -order) as its two parameters. +`handler` is the actual api handler under test. It should be an async function +that accepts NextApiRequest and NextApiResult objects (in that order) as its two +parameters. `test` should be a function that returns a promise (or async) where test assertions can be run. This function receives one parameter: fetch, which is @@ -32,20 +35,20 @@ unfetch's `fetch(...)` function but with the first parameter omitted. #### Parameters: -**({ destructured })**: *object* +**({ destructured })**: _object_ -| Name | Type | -| ------------------ | -------------------------------------------------------------------------------------------------- | -| `handler` | NextApiHandler | -| `params?` | *Record*<*string*, *unknown*> | -| `requestPatcher?` | (`req`: IncomingMessage) => *void* | -| `responsePatcher?` | (`res`: ServerResponse) => *void* | -| `test` | (`obj`: { `fetch`: (`init?`: RequestInit) => *ReturnType*<*typeof* fetch> }) => *Promise*<*void*> | +| Name | Type | +| ------------------ | ------------------------------------------------------------------------------------------------- | +| `handler` | NextApiHandler | +| `params?` | _Record_<_string_, _unknown_> | +| `requestPatcher?` | (`req`: IncomingMessage) => _void_ | +| `responsePatcher?` | (`res`: ServerResponse) => _void_ | +| `test` | (`obj`: { `fetch`: (`init?`: RequestInit) => _ReturnType_<_typeof_ fetch> }) => _Promise_<_void_> | -**Returns:** *Promise*<*void*> +**Returns:** _Promise_<_void_> Defined in: [index.ts:31][2] [1]: README.md#testapihandler - -[2]: https://github.com/Xunnamius/next-test-api-route-handler/blob/473ff50/src/index.ts#L31 +[2]: + https://github.com/Xunnamius/next-test-api-route-handler/blob/f07fd84/src/index.ts#L31 diff --git a/package-lock.json b/package-lock.json index dcf386f3..d1cd33ec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "next-test-api-route-handler", - "version": "1.2.13", + "version": "1.2.14", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 06744018..38ee2eb0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "next-test-api-route-handler", - "version": "1.2.13", + "version": "1.2.14", "description": "Confidently unit test your Next.js API routes/handlers in an isolated Next.js-like environment", "keywords": [ "api",