diff --git a/src/index.test.ts b/src/index.test.ts index 6ea7baea..6fa6c83f 100644 --- a/src/index.test.ts +++ b/src/index.test.ts @@ -1,3 +1,5 @@ +import * as parsers from './parsers'; + import * as environment from '.'; describe('environment', () => { @@ -11,5 +13,13 @@ describe('environment', () => { Object.values(environment.parsers).forEach(parser => { expect(typeof parser).toBe('function'); }); + + Object.entries(parsers).forEach(([name, parser]) => { + if (typeof parser === 'function') { + expect(environment.parsers).toEqual( + expect.objectContaining({ [name]: parser }), + ); + } + }); }); }); diff --git a/src/index.ts b/src/index.ts index d1ff59e8..a18c6f95 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,5 @@ import { + array, boolean, email, float, @@ -17,20 +18,21 @@ import { } from './parsers'; const parsers = { - string, + array, boolean, - integer, - float, email, + float, + integer, url, ipAddress, - port, - whitelist, - positiveInteger, - nonPositiveInteger, negativeInteger, nonNegativeInteger, + nonPositiveInteger, + port, + positiveInteger, regex, + string, + whitelist, }; export { Parser, parsers };