This is the last part in refactoring of the test project. This PR turns on strict mode for typechecking and fixed tests that fail under this mode. PR Close #32783