| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 348e91d commit 6d92391
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -795,7 +795,7 @@ ArrayStream.prototype.writable = true; | |||
| 795 | 795 | ArrayStream.prototype.resume = function() {}; | |
| 796 | 796 | ArrayStream.prototype.write = function() {}; | |
| 797 | 797 | ||
| 798 | - const requireRE = /\brequire\s*\(['"](([\w./-]+\/)?([\w./-]*))/; | ||
| 798 | + const requireRE = /\brequire\s*\(['"](([\w@./-]+\/)?([\w@./-]*))/; | ||
| 799 | 799 | const simpleExpressionRE = | |
| 800 | 800 | /(([a-zA-Z_$](?:\w|\$)*)\.)*([a-zA-Z_$](?:\w|\$)*)\.?$/; | |
| 801 | 801 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,8 +1,14 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | 2 | ||
| 3 | - var common = require('../common'); | ||
| 4 | - var assert = require('assert'); | ||
| 5 | - var repl = require('repl'); | ||
| 3 | + const common = require('../common'); | ||
| 4 | + const assert = require('assert'); | ||
| 5 | + | ||
| 6 | + // We have to change the directory to ../fixtures before requiring repl | ||
| 7 | + // in order to make the tests for completion of node_modules work properly | ||
| 8 | + // since repl modifies module.paths. | ||
| 9 | + process.chdir(common.fixturesDir); | ||
| 10 | + | ||
| 11 | + const repl = require('repl'); | ||
| 6 | 12 | ||
| 7 | 13 | function getNoResultsFunction() { | |
| 8 | 14 | return common.mustCall((err, data) => { | |
@@ -196,6 +202,15 @@ testMe.complete('require(\'n', common.mustCall(function(error, data) { | |||
| 196 | 202 | }); | |
| 197 | 203 | })); | |
| 198 | 204 | ||
| 205 | + { | ||
| 206 | + const expected = ['@nodejsscope', '@nodejsscope/']; | ||
| 207 | + putIn.run(['.clear']); | ||
| 208 | + testMe.complete('require(\'@nodejs', common.mustCall((err, data) => { | ||
| 209 | + assert.strictEqual(err, null); | ||
| 210 | + assert.deepStrictEqual(data, [expected, '@nodejs']); | ||
| 211 | + })); | ||
| 212 | + } | ||
| 213 | + | ||
| 199 | 214 | // Make sure tab completion works on context properties | |
| 200 | 215 | putIn.run(['.clear']); | |
| 201 | 216 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments