Add test to cover this: https://github.com/NativeScript/NativeScript/pull/5850/commits/f87a44f862ae05f7cdd12aefdc5d034b4e21eea3