fix regexp to match require statement without .js extension (#36293)

pull/36364/head
Michał Kozłowski 2019-07-01 22:21:41 +02:00 committed by Parth Parth
parent 331cbb88f8
commit e05e17ce31
1 changed files with 1 additions and 1 deletions

View File

@ -36,7 +36,7 @@ Congratulations- you're at the end of this section of Advanced Node and Express
```yml
tests:
- 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); })
```