pokusew / node-pcsclite

Bindings over pcsclite to access Smart Cards
ISC License
59 stars 55 forks source link

Fix and upgrade test suite #25

Closed roydejong closed 4 years ago

roydejong commented 5 years ago

When running yarn test on Windows 10 x64, with Node v10.15.3, the current version of node-pcsclite produces the following error:

TypeError: stub(obj, 'meth', fn) has been removed, see documentation

This causes all tests to fail on my system. This is related to a deprecation / API change in Sinon: https://github.com/sinonjs/sinon/issues/1761#issuecomment-386034296

Some other things I've noticed:


This PR addresses issues with the test suite by:

roydejong commented 5 years ago

It took a bit of work, but this PR is in a state where all the tests now pass successfully on my system, and everything works as expected.

There's still a bug where mocha doesn't exit on its own. It seems PCSCLite.close() isn't enough to shut everything down cleanly, but I'm not sure how to deal with that. Maybe someone else knows. (Note, it is possible to force mocha to exit anyway after tests with --exit flag)

pokusew commented 4 years ago

Hi @roydejong,

Thank you very much for your PR. I really appreciate the work you did. 👍

I am really sorry it look me so long to review and merge it.

Thanks again.