fix: make most regex tests case insensitive, add note about casing for filename
This commit is contained in:
@@ -46,7 +46,7 @@ assert(code.match(/<html\s*>/gi));
|
||||
Your `html` element should have a closing tag.
|
||||
|
||||
```js
|
||||
assert(code.match(/<\/html\s*>/));
|
||||
assert(code.match(/<\/html\s*>/gi));
|
||||
```
|
||||
|
||||
Your `html` element should be below the `DOCTYPE` declaration.
|
||||
|
@@ -16,7 +16,7 @@ Nest a `link` element within the `head`. Give it a `rel` attribute set to `style
|
||||
Your code should have one `link` element.
|
||||
|
||||
```js
|
||||
assert(code.match(/<link/g)?.length === 1);
|
||||
assert(code.match(/<link/i)?.length === 1);
|
||||
```
|
||||
|
||||
Your `link` element should be a self-closing element.
|
||||
@@ -29,7 +29,7 @@ Your `link` element should be within your `head` element.
|
||||
|
||||
```js
|
||||
const head = code.match(/<head>(.|\r|\n)*<\/head>/i)?.[0];
|
||||
assert(head.match(/<link/g)?.length === 1)
|
||||
assert(head.match(/<link/i)?.length === 1)
|
||||
```
|
||||
|
||||
Your `link` element should have a `rel` attribute with the value `stylesheet`.
|
||||
@@ -44,7 +44,7 @@ Your `link` element should have a `type` attribute with the value `text/css`.
|
||||
assert(code.match(/<link[\s\S]*?type=('|"|`)text\/css\1/gi)?.length === 1);
|
||||
```
|
||||
|
||||
Your `link` element should have an `href` attribute with the value `styles.css`.
|
||||
Your `link` element should have an `href` attribute with the value `styles.css`. Remember, casing matters when you link to an external file.
|
||||
|
||||
```js
|
||||
assert.match(code, /<link[\s\S]*?href=('|"|`)(\.\/)?styles\.css\1/);
|
||||
|
@@ -25,7 +25,7 @@ Your `.red` CSS rule should have a `background` property with the value `linear-
|
||||
|
||||
```js
|
||||
assert(
|
||||
__helpers.removeWhiteSpace($('style').text()).match(/\.red{.*background:linear-gradient\(90deg\).*}/g)
|
||||
__helpers.removeWhiteSpace($('style').text()).match(/\.red{.*background:linear-gradient\(90deg\).*}/gi)
|
||||
);
|
||||
```
|
||||
|
||||
|
@@ -17,7 +17,7 @@ Your `.red` CSS rule should have a `background` property with the value `linear-
|
||||
|
||||
```js
|
||||
assert(
|
||||
__helpers.removeWhiteSpace($('style').text()).match(/\.red{.*background:linear-gradient\(90deg,rgb\(255,0,0\)\).*}/g)
|
||||
__helpers.removeWhiteSpace($('style').text()).match(/\.red{.*background:linear-gradient\(90deg,rgb\(255,0,0\)\).*}/gi)
|
||||
);
|
||||
```
|
||||
|
||||
|
@@ -17,7 +17,7 @@ Your `.green` CSS rule should have a `background` property with the value `linea
|
||||
|
||||
```js
|
||||
assert(
|
||||
__helpers.removeWhiteSpace($('style').text()).match(/\.green{.*background:linear-gradient\(180deg,#55680D\).*}/g)
|
||||
__helpers.removeWhiteSpace($('style').text()).match(/\.green{.*background:linear-gradient\(180deg,#55680D\).*}/gi)
|
||||
);
|
||||
```
|
||||
|
||||
|
@@ -15,7 +15,7 @@ Your `.blue` CSS rule should have a `background` property with the value `linear
|
||||
|
||||
```js
|
||||
assert(
|
||||
__helpers.removeWhiteSpace($('style').text()).match(/\.blue{.*linear-gradient\(hsl\(186,76%,16%\)\).*}/g)
|
||||
__helpers.removeWhiteSpace($('style').text()).match(/\.blue{.*linear-gradient\(hsl\(186,76%,16%\)\).*}/gi)
|
||||
);
|
||||
```
|
||||
|
||||
|
Reference in New Issue
Block a user