I have small functions, which defines the AD connection and a function which creates all queries to find user information.
How can I test functions like this with chai/mocha?
I have small functions, which defines the AD connection and a function which creates all queries to find user information.
How can I test functions like this with chai/mocha?
Active Directory uses LDAP protocol for querying. So tou can use an LDAP mock server that starts at the start of the required testing section. There is a npm package for LDAP mock server that reads the its data from json files: https://github.com/veo-labs/ldap-server-mock