fix regexp to match require statement without .js extension (#36293)
This commit is contained in:
committed by
Parth Parth
parent
331cbb88f8
commit
e05e17ce31
@ -36,7 +36,7 @@ Congratulations- you're at the end of this section of Advanced Node and Express
|
|||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: Modules present
|
- text: Modules present
|
||||||
testString: getUserInput => $.get(getUserInput('url')+ '/_api/server.js') .then(data => { assert.match(data, /require.*("|').\/routes.js("|')/gi, 'You should have required your new files'); assert.match(data, /mongo.connect[^]*routes/gi, 'Your new modules should be called after your connection to the database'); }, xhr => { throw new Error(xhr.statusText); })
|
testString: getUserInput => $.get(getUserInput('url')+ '/_api/server.js') .then(data => { assert.match(data, /require\s*\(('|")\.\/routes(\.js)?\1\)/gi, 'You should have required your new files'); assert.match(data, /mongo.connect[^]*routes/gi, 'Your new modules should be called after your connection to the database'); }, xhr => { throw new Error(xhr.statusText); })
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user