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:
@ -32,7 +32,13 @@ assert(
|
|||||||
There should be a listener function subscribed to the store using `store.subscribe`.
|
There should be a listener function subscribed to the store using `store.subscribe`.
|
||||||
|
|
||||||
```js
|
```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.
|
The callback to `store.subscribe` should also increment the global `count` variable as the store is updated.
|
||||||
|
Reference in New Issue
Block a user