Skip to content
This repository was archived by the owner on Jun 4, 2024. It is now read-only.
This repository was archived by the owner on Jun 4, 2024. It is now read-only.

Intimidating code... #26

@gdborton

Description

@gdborton

While digging into #24, it took me a long time to understand what was going on in the codebase, and then took me even longer to understand why.

After trying to grok the code for longer than I'd like to admit, I can see that...

This code:

return setThisDescription(concatThis(this, newWrappers), description);

is essentially a different way of doing this:

return new MochaWrapper({
  wrappers: newWrappers,
  description,
});

And that because of attempts to maintain privacy this...

return someChainableFunction(someOtherChainableFunction(myInstance));

was basically the same as this...

return this.someOtherChainableFunction().someChainableFunction();

My question is... would you be ok with:

  1. Changing the functional code to be more object oriented (we're passing instance a lot)
  2. Removing the attempts at maintaining privacy

^ I think that doing these would help to make the code much more approachable.

We could be explicit in that the internal functions/parameters are not part of the api, and will break without breaking changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions