Skip to content

Glossary: Software Design Patterns in JavaScript

Injected clock

Also written: clock

A function passed in that returns the current time as a Date, such as () => new Date(). A test can pass one that always returns the same time.

Where the book teaches it

Related terms

Dependency injectionStub