buffer: fix deprecation warning emit

Due to npm using workers on Windows which inititate processes
for code within node_modules, the current way of testing is a
little too strict to catch all occurrences.

PR-URL: https://github.com/nodejs/node/pull/20163
Fixes: https://github.com/nodejs/node/issues/20160
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
This commit is contained in:
Anatoli Papirovski authored and James M Snell committed 2018-04-20 13:17:42 -07:00
1 parent 4a96a5041b
commit d7994764fa
2 files changed
+5 -17

No files matched your search

@@ -20,16 +20,18 @@ function test(main, callSite, expected) {
assert.strictEqual(stderr.trim(), '');
}
test('/a/node_modules/b.js', '/a/node_modules/x.js', true);
test('/a/node_modules/b.js', '/a/node_modules/x.js', false);
test('/a/node_modules/b.js', '/a/node_modules/foo/node_modules/x.js', false);
test('/a/node_modules/foo/node_modules/b.js', '/a/node_modules/x.js', false);
test('/node_modules/foo/b.js', '/node_modules/foo/node_modules/x.js', false);
test('/a.js', '/b.js', true);
test('/a.js', '/node_modules/b.js', false);
test('c:\\a\\node_modules\\b.js', 'c:\\a\\node_modules\\x.js', true);
test('/node_modules/a.js.js', '/b.js', true);
test('c:\\a\\node_modules\\b.js', 'c:\\a\\node_modules\\x.js', false);
test('c:\\a\\node_modules\\b.js',
'c:\\a\\node_modules\\foo\\node_modules\\x.js', false);
test('c:\\node_modules\\foo\\b.js',
'c:\\node_modules\\foo\\node_modules\\x.js', false);
test('c:\\a.js', 'c:\\b.js', true);
test('c:\\a.js', 'c:\\node_modules\\b.js', false);
test('c:\\node_modules\\a.js', 'c:\\b.js', true);