One common problem I have, is that sometimes my .npmignore file is too aggressive, and I ignore files that I actually will to include in the NPM tarball.
My question is
I had the exact same problem, so I created a package called package-preview. What package-preview does is:
This allows you to basically require the package as a dependency in your tests. So in tests of "awesome-pkg", intead of require('../lib')
you write require('awesome-pkg')
I use this package in all the pnpm repos for several months and it works really well. I also posted an article about this package that explains all the different errors that it can catch: Never ever forget to install a dependency