From 680d0e67dfa6dc7063fb4cacaa144e291b467001 Mon Sep 17 00:00:00 2001 From: Oleksandr Kushchak Date: Thu, 22 Feb 2018 10:25:45 +0000 Subject: [PATCH 1/2] test/bare.js: fix file path Fixes: https://github.com/browserify/browserify/issues/1809 https://github.com/nodejs/citgm/issues/545 --- test/bare.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/bare.js b/test/bare.js index 2526e97c7..cf9562284 100644 --- a/test/bare.js +++ b/test/bare.js @@ -106,7 +106,7 @@ test('bare inserts __filename,__dirname but not process,global,Buffer', function test('bare inserts dynamic __filename,__dirname', function (t) { t.plan(2); - var file = path.join(tmpdir, 'dirname-filename.js'); + var file = 'dirname-filename.js'; fs.writeFileSync( file, From 1ab192c14cfe435dbbd35ddeb3e73a20b1ea801c Mon Sep 17 00:00:00 2001 From: Oleksandr Kushchak Date: Thu, 22 Feb 2018 12:48:20 +0000 Subject: [PATCH 2/2] test/bare.js: nits --- test/bare.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/bare.js b/test/bare.js index cf9562284..039c587a8 100644 --- a/test/bare.js +++ b/test/bare.js @@ -106,7 +106,7 @@ test('bare inserts __filename,__dirname but not process,global,Buffer', function test('bare inserts dynamic __filename,__dirname', function (t) { t.plan(2); - var file = 'dirname-filename.js'; + var file = path.join(tmpdir, 'dirname-filename.js'); fs.writeFileSync( file, @@ -122,7 +122,7 @@ test('bare inserts dynamic __filename,__dirname', function (t) { ps.stdout.pipe(concat(function (body) { vm.runInNewContext(body, { require: require, - __dirname: path.dirname(file), + __dirname: process.cwd(), console: { log: function (msg) { t.same(msg, [