Libraries should skip lockfiles because they are ignored by the end user and therefore any testing you do based on them helps no one.
I’ve had lockfiles being broken for no reason* so if you can avoid them, do.
* For example, multiple versions of the same package were installed after several install/updates, but nuking the lock would avoid this issue and solve the problems it caused.