marmelab / gremlins.js

Monkey testing library for web apps and Node.js
https://marmelab.com/blog/2020/06/02/gremlins-2.html
MIT License
9.03k stars 426 forks source link

Incorrect params for `customGremlin` in README #170

Closed CodeWithOz closed 4 years ago

CodeWithOz commented 4 years ago

The Basic Usage section of the README shows that the customGremlin function accepts 2 arguments, logger and randomizer, but in v2.2.0 the function receives only one argument which is an object that contains logger, randomizer, and window properties. Perhaps the Basic Usage code was meant to be this:

function customGremlin({logger, randomizer}) {
...
HALLERPierre commented 4 years ago

Hi and thank you for your issue :smile: !

Yes you're absolutely right, the readme is wrong. The correct way is:

function customGremlin({ logger, randomizer, window }) {
...
HALLERPierre commented 4 years ago

I updated the Readme.