Skip to content

Make clock stubbable from consuming apps #2

@hurrymaplelad

Description

@hurrymaplelad

Currently, this module depends on node-clock. It may or may not share it's clock instance with consuming apps.

When this module installs its own clock instance, clock.now() will not be stubbed in consuming app specs.

Options include:

  1. Enforce clock singleton using globals, a la node-fibers
  2. Pass the clock into a module config method, a la goodeggs-emailer.
  3. Don't call clock.now() within formatters, instead pass in base time to methods that do relative time formatting.

I lean towards option 3, but it's the biggest interface change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions