0

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?

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
JScripter
  • 123
  • 2
  • 9
  • check https://stackoverflow.com/questions/12354107/how-to-fake-active-directory – AZ_ Aug 22 '19 at 12:21

1 Answers1

0

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

dima golovin
  • 262
  • 2
  • 8