thefrontside / simulacrum

A simulation platform for use during testing, during development and for high-fidelity application previews
88 stars 14 forks source link

Use LDAP client as a resource in tests #192

Closed cowboyd closed 2 years ago

cowboyd commented 2 years ago

Motivation

As part of adding the root DSE handler to the ldap simulator, I found that my bindings were getting out of sync because the after each hook was not attached to the appropriate scope. Since this is Effection, and we can use resources that automatically teardown after every test, let's make this implicit, that way our tests can be more flexible.

Approach

This takes out the raw usage of the LDAP client, and wraps it in a resource. Specifically, in order to get to the ldap client, you must first bind() and then you can execute commands such as search. search() itself has been implemented as a stream which makes working with it a lot nicer.

netlify[bot] commented 2 years ago

Deploy Preview for simulacrum canceled.

Name Link
Latest commit 8f52aa797d7b0c83c32ffc131162d3fdec342014
Latest deploy log https://app.netlify.com/sites/simulacrum/deploys/624d8c42ad02350008e938ae