Your tests are still relying on global state shared across multiple tests: `registryData` and `pkg`. This makes it more difficult to understand what conditions are being tested and also adding new tests using different test data.

Please refactor this as suggested in my earlier comment, i.e. every test should be self-contained. There should be _Arrange_ block (where you configure data mock with a single package), _Act_ block (the call to `index()`) and _Assert_ block (expectations). You do have Act & Assert, but are missing Arrange.