fix(curriculum): check if count gets incremented by function (#41856)

* fix(curriculum): check if count gets incremented by function

* update text

* Update regex to look for whitespace

* look for function globally

* Apply suggestions from gikf

Co-authored-by: gikf <60067306+gikf@users.noreply.github.com>

Co-authored-by: gikf <60067306+gikf@users.noreply.github.com>
This commit is contained in:
Sem Bauke
2021-04-23 18:01:54 +02:00
committed by GitHub
parent 81e84542e4
commit 99cecfb581

View File

@ -32,7 +32,13 @@ assert(
There should be a listener function subscribed to the store using `store.subscribe`.
```js
(getUserInput) => assert(getUserInput('index').includes('store.subscribe('));
(getUserInput) => assert(getUserInput('index').match(/store\s*\.\s*subscribe\(/gm));
```
The `store.subscribe` should receive a function.
```js
(getUserInput) => assert(getUserInput('index').match(/(\s*function\s*)|(\s*\(\s*\)\s*=>)/gm))
```
The callback to `store.subscribe` should also increment the global `count` variable as the store is updated.