mirror of
https://github.com/vale981/apollo-server
synced 2025-03-06 02:01:40 -05:00
![]() The techniques previously used to skip particular tests for particular Node.js versions (for example, file uploads, Hapi, etc.) were problematic in a couple ways: 1. `return`-ing outside a function (say, at the top level of a module) is not valid ECMAScript. While it works in this current state, it only works because of Babel's wrapping scope. As we move toward less and less transpiled modules, this would become problematic anyway, but it's a short-term blocker for me since I intend on dropping the `skipBabel` option we currently pass to` `ts-jest` in its current (`package.json`) configuration. (My editor also dislikes top-level `return`, expectedly.) 2. By `return`-ing from a test which we wish to skip conditionally, we avoid the awareness which is provided by Jest (automatically) when using its built-in `.skip` helpers. By switching to technique I've employed here, we're able to see `<num> skipped` in Jest's output and (rightfully) be able to question why something is being skipped. By using the `atLeastMajorNodeVersion` helper, we'll also be able to more easily find where this pattern is used in test-cases, to more easily re-evaluate their use-cases when we add support newer Node.js versions. |
||
---|---|---|
.. | ||
src | ||
.npmignore | ||
package.json | ||
tsconfig.json |