Ad
  • Custom User Avatar

    Order of events in each output array is not defined.

  • Custom User Avatar

    As mentioned below, the specs are incomplete: what if toggle contains strings that is contained in do/undo too?

  • Custom User Avatar

    "Performance test" is not actually testing for performance: input size is too small.

  • Custom User Avatar

    namespace should be passed in as an argument, not as a global variable.

  • Custom User Avatar

    Needs actual random tests.

  • Default User Avatar

    What should happen if you have the following?

    manageEventsStrings("open toggle foo baz", "close bar baz", "toggle");
    manageEventsStrings("open foo baz", "close toggle bar baz", "toggle");
    

    I'd expect that you shouldn't have toggle in either doActions or undoActions, since it's found in toggleActions, so the result from both of those should be ["open.codeWars foo.codeWars", "close.codeWars bar.codeWars", "toggle.codeWars baz.codeWars"].

    That isn't really clear from the description, though: any verb that is found in both doActions and undoActions should be added to toggleActions, and then any verb found in toggleActions should be skipped in both doActions and undoActions if it occurs in either of those. You only covered the case where it's found in both doActions and undoActions, not when it occurred in only one of them but also in toggleActions.