fix(curriculum): tests passing with seed code in Spam filter (#55589)

This commit is contained in:
Krzysztof G.
2024-08-13 01:36:20 +02:00
committed by GitHub
parent dcc3b2746b
commit e647da8d41
5 changed files with 6 additions and 6 deletions
@@ -32,7 +32,7 @@ assert.match(code, /const\s+result\s*=/);
Your `result` variable should have the value of `document.getElementById('result')`.
```js
assert.deepEqual(result, document.getElementById('result'));
assert.match(code, /const\s+result\s*=\s*document\.getElementById\(\s*('|")result\1\s*\)/);
```
You should use `const` to declare a `checkMessageButton` variable.
@@ -25,7 +25,7 @@ Use `regex` as the parameter for the callback function, for clarity.
Your `isSpam` function should implicitly return the result of `denyList.some()`.
```js
assert.match(code, /const\s+isSpam\s*=\s*(\(\s*msg\s*\)|msg)\s*=>\s*/)
assert.match(code, /const\s+isSpam\s*=\s*(\(\s*msg\s*\)|msg)\s*=>\s*denyList\.some\(\s*[\s\S]*\)/)
```
Your `.some()` method should use arrow syntax for the callback.
@@ -27,7 +27,7 @@ Your character class should be `0-9`.
assert.match(dollarRegex.source, /\[0-9\] dollars/);
```
Your `dollarRegex` should match `1 dollars`.
Your `dollarRegex` should still match `"1 dollars"`.
```js
assert.match('1 dollars', dollarRegex);
@@ -25,13 +25,13 @@ Your `dollarRegex` should use the `+` quantifier on your `[0-9]` character class
assert.match(dollarRegex.source, /\[0-9\]\+/);
```
Your `dollarRegex` should match `100 dollars`.
Your `dollarRegex` should still match `"100 dollars"`.
```js
assert.match('100 dollars', dollarRegex);
```
Your `dollarRegex` should match `3 dollars`.
Your `dollarRegex` should still match `"3 dollars"`.
```js
assert.match('3 dollars', dollarRegex);
@@ -16,7 +16,7 @@ To do this, start by checking for spaces before and after your pattern. You can
Your `freeRegex` should use the `\s` token.
```js
assert.match(freeRegex.source, /\s/);
assert.match(freeRegex.source, /\\s/);
```
Your `freeRegex` should look for spaces at the beginning and end of your pattern.