[BREAKING] Fix #155 | Upgrade jest & node version #172
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changelog:
Spec
andformatSpecDescription
jest
andts-jest
What's wrong:
Currently Jest encounter an issue I've never seen before, it's probably related to the fact I'm using node 16 but maybe not, I've no time to dig into.
Breaking change
This PR introduce many breaking change, then envalid version must be updated consequently.
default
anddevDefault
are now exclusively optionnal string?: string
. As explained on default and default:Dev should be of type string #155 issue, env var are only string and parsing always the same kind of input is the best way to avoid typing and runtime issues. It ensure the consistency of MakeValidator and developpers can output any type of value anywayurl()
now returnURL
instead of a string, then we can manipulate it the right way manually, If we need to use it as string the module provide everything we need.str
now validate if the string is empty by trimming spaces instead of just checking the type, as input can only be string the type check is now useless.All validators have been updated to follow the new way to make validators.
Using it before merging
I'm actually using this PR in production environment and will update it if I found any issue related to those changes. For those who would like to test it and give an advice here's the way to install this version:
yarn add https://github.com/antoine-pous/envalid.git
npm i https://github.com/antoine-pous/envalid