npm-packages: Remove duplication in tests.