article thumbnail

Testing Without Mocks: A Pattern Language

James Shore

To avoid manually constructing the entire dependency chain, use Parameterless Instantiation with Zero-Impact Instantiation. For example, an immutable Address class should be constructed with its street, city, and so forth. In contrast, if the LoginController tests stubbed or mocked out Auth0Client , the chain would be broken.

Testing 138
article thumbnail

Testing Without Mocks: A Pattern Language

James Shore

To avoid constructing the entire dependency chain, use Zero-Impact Instantiation and Parameterless Instantiation. it("uses hosted page for authentication", function() { const client = createClient({ // Use the factory function. The state of immutable objects is determined when the object is constructed, and never changes afterwards.

Testing 88
article thumbnail

Testing Without Mocks: A Pattern Language

James Shore

To avoid constructing the entire dependency chain, use Zero-Impact Instantiation and Parameterless Instantiation. it("uses hosted page for authentication", function() { const client = createClient({ // Use the factory function. The state of immutable objects is determined when the object is constructed, and never changes afterwards.

Testing 40