From 949e0d28cfeb5e4a990e7dffb9f46140c13b9f0f Mon Sep 17 00:00:00 2001 From: Volkan Sen Date: Sat, 24 Apr 2021 17:34:04 +0300 Subject: [PATCH 1/2] - Upgrade camelcase version for `jest-validate` workspace. - Call `camelcase` function providing `en-US` as locale while validating CLI options. --- CHANGELOG.md | 1 + package.json | 2 +- packages/jest-validate/package.json | 2 +- packages/jest-validate/src/validateCLIOptions.ts | 2 +- yarn.lock | 4 ++-- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e38d4a8e26a..c93e4dbc3b35 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -94,6 +94,7 @@ - `[jest-transform]` [**BREAKING**] Refactor API of transformers to pass an options bag rather than separate `config` and other options ([#10834](https://github.com/facebook/jest/pull/10834)) - `[jest-types]` Fix `Config.ts` `projects` types ([#11285](https://github.com/facebook/jest/pull/11285)) - `[jest-util]` Replace micromatch with picomatch to fix issues with negated globs ([#11287](https://github.com/facebook/jest/pull/11287)) +- `[jest-validate]` Use `en-US` locale to avoid case conversion problems while validating CLI options on machines with some certain locales(e.g. Turkish) set as default locale. - `[jest-worker]` [**BREAKING**] Use named exports ([#10623](https://github.com/facebook/jest/pull/10623)) - `[jest-worker]` Do not swallow errors during serialization ([#10984](https://github.com/facebook/jest/pull/10984)) - `[jest-worker]` Handle `ERR_IPC_CHANNEL_CLOSED` errors properly ([#11143](https://github.com/facebook/jest/pull/11143)) diff --git a/package.json b/package.json index 9199313338af..f8531e6ba0d1 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "ansi-regex": "^5.0.0", "ansi-styles": "^5.0.0", "babel-plugin-replace-ts-export-assignment": "^0.0.2", - "camelcase": "^6.0.0", + "camelcase": "^6.2.0", "chalk": "^4.0.0", "chokidar": "^3.3.0", "codecov": "^3.0.0", diff --git a/packages/jest-validate/package.json b/packages/jest-validate/package.json index e0770b3dfd98..58694e2f73b9 100644 --- a/packages/jest-validate/package.json +++ b/packages/jest-validate/package.json @@ -15,7 +15,7 @@ }, "dependencies": { "@jest/types": "^27.0.0-next.8", - "camelcase": "^6.0.0", + "camelcase": "^6.2.0", "chalk": "^4.0.0", "jest-get-type": "^27.0.0-next.9", "leven": "^3.1.0", diff --git a/packages/jest-validate/src/validateCLIOptions.ts b/packages/jest-validate/src/validateCLIOptions.ts index ea445fc932b8..ae71952eeefa 100644 --- a/packages/jest-validate/src/validateCLIOptions.ts +++ b/packages/jest-validate/src/validateCLIOptions.ts @@ -78,7 +78,7 @@ export default function validateCLIOptions( ); const unrecognizedOptions = Object.keys(argv).filter( arg => - !allowedOptions.has(camelcase(arg)) && + !allowedOptions.has(camelcase(arg, {locale: 'en-US'})) && !allowedOptions.has(arg) && (!rawArgv.length || rawArgv.includes(arg)), [], diff --git a/yarn.lock b/yarn.lock index 59642888f96d..5d6b9299da64 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2530,7 +2530,7 @@ __metadata: ansi-regex: ^5.0.0 ansi-styles: ^5.0.0 babel-plugin-replace-ts-export-assignment: ^0.0.2 - camelcase: ^6.0.0 + camelcase: ^6.2.0 chalk: ^4.0.0 chokidar: ^3.3.0 codecov: ^3.0.0 @@ -13352,7 +13352,7 @@ fsevents@^1.2.7: dependencies: "@jest/types": ^27.0.0-next.8 "@types/yargs": ^16.0.0 - camelcase: ^6.0.0 + camelcase: ^6.2.0 chalk: ^4.0.0 jest-get-type: ^27.0.0-next.9 leven: ^3.1.0 From d30ce848548c695434f31763031fd85983a64958 Mon Sep 17 00:00:00 2001 From: Volkan Sen Date: Fri, 14 May 2021 19:21:42 +0300 Subject: [PATCH 2/2] Update CHANGELOG.log with PR link. --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c93e4dbc3b35..4dfc574b9fdc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -94,7 +94,7 @@ - `[jest-transform]` [**BREAKING**] Refactor API of transformers to pass an options bag rather than separate `config` and other options ([#10834](https://github.com/facebook/jest/pull/10834)) - `[jest-types]` Fix `Config.ts` `projects` types ([#11285](https://github.com/facebook/jest/pull/11285)) - `[jest-util]` Replace micromatch with picomatch to fix issues with negated globs ([#11287](https://github.com/facebook/jest/pull/11287)) -- `[jest-validate]` Use `en-US` locale to avoid case conversion problems while validating CLI options on machines with some certain locales(e.g. Turkish) set as default locale. +- `[jest-validate]` Use `en-US` locale to avoid case conversion problems while validating CLI options on machines with some certain locales(e.g. Turkish) set as default locale. ([#11412](https://github.com/facebook/jest/pull/11412)) - `[jest-worker]` [**BREAKING**] Use named exports ([#10623](https://github.com/facebook/jest/pull/10623)) - `[jest-worker]` Do not swallow errors during serialization ([#10984](https://github.com/facebook/jest/pull/10984)) - `[jest-worker]` Handle `ERR_IPC_CHANNEL_CLOSED` errors properly ([#11143](https://github.com/facebook/jest/pull/11143))