Skip to content

Adopt the Fluent Interface for simulate #8

@cristiingineru

Description

@cristiingineru

https://en.wikipedia.org/wiki/Fluent_interface#JavaScript

This change should allow writing tests like this:

simulate
  .mouseUp(eventHolder, x + 20, y + 30);
  .tick(50)
  .dblclick(eventHolder, x + 20, y + 30)
  .tick(50);

instead of:

simulate.mouseUp(eventHolder, x + 20, y + 30);
jasmine.clock().tick(50);

simulate.dblclick(eventHolder, x + 20, y + 30);
jasmine.clock().tick(50);

It's a pity jasmine will be read from the global namespace, but I think overall the code will be more readable.

Metadata

Metadata

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