[Bug]: Left side of comma operator is unused and has no side effect (v27.1.3)
See original GitHub issueVersion
27.1.3
Steps to reproduce
Reproduction steps:
- Clone my repository at https://github.com/flo-sch/ts-jest-27-1-3-issue-reproduction-global-teardown
- Follow the instructions in README.md to both get started and reproduce the bug
The setup is a bit complicated since the tests are backed by a postgresql database, hopefully the instructions are clear enough
Expected behavior
Updating ts-jest from v27.1.2 to v27.1.3 should not break my tests
Actual behavior
Something in v27.1.3 make my tests fail with an error message
Debug log
{“category”:1,“code”:17016,“key”:“The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_com_17016”,“message”:“The ‘jsxFragmentFactory’ compiler option must be provided to use JSX fragments with the ‘jsxFactory’ compiler option.”},“The_last_overload_gave_the_following_error”:{“category”:1,“code”:2770,“key”:“The_last_overload_gave_the_following_error_2770”,“message”:“The last overload gave the following error.”},“The_last_overload_is_declared_here”:{“category”:1,“code”:2771,“key”:“The_last_overload_is_declared_here_2771”,“message”:“The last overload is declared here.”},“The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern”:{“category”:1,“code”:2491,“key”:“The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern_2491”,“message”:“The left-hand side of a ‘for…in’ statement cannot be a destructuring pattern.”},“The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation”:{“category”:1,“code”:2404,“key”:“The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation_2404”,“message”:“The left-hand side of a ‘for…in’ statement cannot use a type annotation.”},“The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access”:{“category”:1,“code”:2780,“key”:“The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access_2780”,“message”:“The left-hand side of a ‘for…in’ statement may not be an optional property access.”},“The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access”:{“category”:1,“code”:2406,“key”:“The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access_2406”,“message”:“The left-hand side of a ‘for…in’ statement must be a variable or a property access.”},“The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any”:{“category”:1,“code”:2405,“key”:“The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any_2405”,“message”:“The left-hand side of a ‘for…in’ statement must be of type ‘string’ or ‘any’.”},“The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation”:{“category”:1,“code”:2483,“key”:“The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation_2483”,“message”:“The left-hand side of a ‘for…of’ statement cannot use a type annotation.”},“The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access”:{“category”:1,“code”:2781,“key”:“The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access_2781”,“message”:“The left-hand side of a ‘for…of’ statement may not be an optional property access.”},“The_left_hand_side_of_a_for_of_statement_may_not_be_async”:{“category”:1,“code”:1106,“key”:“The_left_hand_side_of_a_for_of_statement_may_not_be_async_1106”,“message”:“The left-hand side of a ‘for…of’ statement may not be ‘async’.”},“The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access”:{“category”:1,“code”:2487,“key”:“The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access_2487”,“message”:“The left-hand side of a ‘for…of’ statement must be a variable or a property access.”},“The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type”:{“category”:1,“code”:2362,“key”:“The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2362”,“message”:“The left-hand side of an arithmetic operation must be of type ‘any’, ‘number’, ‘bigint’ or an enum type.”},“The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access”:{“category”:1,“code”:2779,“key”:“The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access_2779”,“message”:“The left-hand side of an assignment expression may not be an optional property access.”},“The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access”:{“category”:1,“code”:2364,“key”:“The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access_2364”,“message”:“The left-hand side of an assignment expression must be a variable or a property access.”},“The_left_hand_side_of_an_in_expression_must_be_a_private_identifier_or_of_type_any_string_number_or_symbol”:{“category”:1,“code”:2360,“key”:“The_left_hand_side_of_an_in_expression_must_be_a_private_identifier_or_of_type_any_string_number_or__2360”,“message”:“The left-hand side of an ‘in’ expression must be a private identifier or of type ‘any’, ‘string’, ‘number’, or ‘symbol’.”},“The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter”:{“category”:1,“code”:2358,“key”:“The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_paramete_2358”,“message”:“The left-hand side of an ‘instanceof’ expression must be of type ‘any’, an object type or a type parameter.”},“The_locale_used_when_displaying_messages_to_the_user_e_g_en_us”:{“category”:3,“code”:6156,“key”:“The_locale_used_when_displaying_messages_to_the_user_e_g_en_us_6156”,“message”:“The locale used when displaying messages to the user (e.g. ‘en-us’)”},“The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files”:{“category”:3,“code”:6136,“key”:“The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files_6136”,“message”:“The maximum dependency depth to search under node_modules and load JavaScript files.”},
Additional context
Hi,
I am running integration tests on a Fastify server application backed by a postgresql database, within a https://nx.dev monorepository workspace.
While the jest setup seems a bit flaky to me, tests successfully run using ts-jest 27.1.2
.
Migrating to 27.1.3
however make them fail with the following message (as illustrated in the repository branch):
[TSError: apps/example-app-integration/jest/globalTeardown.ts:5:13 - error TS2695: Left side of comma operator is unused and has no side effects.
I am not fully sure if ts-jest in itself is the problem, perhaps it is how I register my global scripts, but cannot figure out what the issue is, technically 😅
Environment
System:
OS: macOS 12.1
CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Binaries:
Node: 16.13.2 - ~/.nvm/versions/node/v16.13.2/bin/node
Yarn: 1.22.17 - /usr/local/bin/yarn
npm: 8.3.1 - ~/.nvm/versions/node/v16.13.2/bin/npm
npmPackages:
jest: ^27.5 => 27.5.1
Issue Analytics
- State:
- Created 2 years ago
- Comments:8
Top GitHub Comments
I’m having the same issue in
globalTeardown
,globalSetup
works fine. I’ve updated jest and ts-jest to v28 and get the same error.I’d recommend to stay on
27.1.2
since27.1.3
doesn’t contain anything important. We are likely going to change internalts-jest
in v28 which will likely fix this issue.Besides, it would be more helpful if your repo can be smaller so we can get a chance to test this bug without complex setup with postgresql.