[Pkg-javascript-commits] [node-module-deps] 308/444: Fix tests failing on Windows
Bastien Roucariès
rouca at moszumanska.debian.org
Fri Dec 15 09:48:08 UTC 2017
This is an automated email from the git hooks/post-receive script.
rouca pushed a commit to branch master
in repository node-module-deps.
commit c0e2a2544b9e2b8699934a010ffb2d5e51ca83af
Author: Greg Smith <smr.kyu at gmail.com>
Date: Wed Oct 22 16:47:24 2014 -0500
Fix tests failing on Windows
---
test/bundle.js | 3 ++-
test/cycle.js | 3 ++-
test/dotdot.js | 9 +++++----
test/expose.js | 5 +++--
test/noparse_row.js | 7 ++++---
test/pkg.js | 5 +++--
test/pkg_filter.js | 3 ++-
test/source.js | 9 +++++----
test/tr_2dep_module.js | 3 ++-
test/tr_err.js | 5 +++--
test/tr_fn.js | 3 ++-
test/tr_global.js | 7 ++++---
test/tr_module.js | 3 ++-
test/tr_opts.js | 3 ++-
test/tr_rel.js | 3 ++-
test/tr_sh.js | 3 ++-
test/tr_whole_package.js | 3 ++-
17 files changed, 47 insertions(+), 30 deletions(-)
diff --git a/test/bundle.js b/test/bundle.js
index 9ce44f9..4866c2f 100644
--- a/test/bundle.js
+++ b/test/bundle.js
@@ -2,11 +2,12 @@ var parser = require('../');
var test = require('tape');
var JSONStream = require('JSONStream');
var packer = require('browser-pack');
+var path = require('path');
test('bundle', function (t) {
t.plan(1);
var p = parser();
- p.end(__dirname + '/files/main.js');
+ p.end(path.join(__dirname, '/files/main.js'));
p.on('error', t.fail.bind(t));
var pack = packer();
diff --git a/test/cycle.js b/test/cycle.js
index 3efdca6..32a2d60 100644
--- a/test/cycle.js
+++ b/test/cycle.js
@@ -3,11 +3,12 @@ var test = require('tape');
var JSONStream = require('JSONStream');
var packer = require('browser-pack');
var concat = require('concat-stream');
+var path = require('path');
test('cycle', function (t) {
t.plan(1);
var p = mdeps();
- p.end(__dirname + '/cycle/main.js');
+ p.end(path.join(__dirname, '/cycle/main.js'));
var pack = packer();
p.pipe(JSONStream.stringify()).pipe(pack).pipe(concat(function (src) {
diff --git a/test/dotdot.js b/test/dotdot.js
index d57a4ed..cb7f1cb 100644
--- a/test/dotdot.js
+++ b/test/dotdot.js
@@ -1,16 +1,17 @@
var mdeps = require('../');
var test = require('tape');
var through = require('through2');
+var path = require('path');
-test(function (t) {
+test('dotdot', function (t) {
var expected = [
- __dirname + '/dotdot/index.js',
- __dirname + '/dotdot/abc/index.js'
+ path.join(__dirname, '/dotdot/index.js'),
+ path.join(__dirname, '/dotdot/abc/index.js')
];
t.plan(expected.length);
var d = mdeps();
- d.end(__dirname + '/dotdot/abc/index.js');
+ d.end(path.join(__dirname, '/dotdot/abc/index.js'));
d.pipe(through.obj(function (row, enc, next) {
t.deepEqual(row.file, expected.shift());
diff --git a/test/expose.js b/test/expose.js
index 2bd8027..f03703c 100644
--- a/test/expose.js
+++ b/test/expose.js
@@ -1,10 +1,11 @@
var parser = require('../');
var test = require('tape');
var fs = require('fs');
+var path = require('path');
var files = {
- foo: __dirname + '/files/foo.js',
- bar: __dirname + '/files/bar.js'
+ foo: path.join(__dirname, '/files/foo.js'),
+ bar: path.join(__dirname, '/files/bar.js')
};
var sources = Object.keys(files).reduce(function (acc, file) {
diff --git a/test/noparse_row.js b/test/noparse_row.js
index 947bc0e..e114ad7 100644
--- a/test/noparse_row.js
+++ b/test/noparse_row.js
@@ -2,11 +2,12 @@ var parser = require('../');
var test = require('tape');
var fs = require('fs');
var concat = require('concat-stream');
+var path = require('path');
var files = {
- main: __dirname + '/files/main.js',
- foo: __dirname + '/files/foo.js',
- bar: __dirname + '/files/bar.js'
+ main: path.join(__dirname, '/files/main.js'),
+ foo: path.join(__dirname, '/files/foo.js'),
+ bar: path.join(__dirname, '/files/bar.js')
};
var sources = Object.keys(files).reduce(function (acc, file) {
diff --git a/test/pkg.js b/test/pkg.js
index d2394bf..2d9d614 100644
--- a/test/pkg.js
+++ b/test/pkg.js
@@ -1,8 +1,9 @@
var mdeps = require('../');
var test = require('tape');
+var path = require('path');
var pkg = require('./pkg/package.json');
-pkg.__dirname = __dirname + '/pkg';
+pkg.__dirname = path.join(__dirname, '/pkg');
test('pkg', function (t) {
t.plan(1);
@@ -11,6 +12,6 @@ test('pkg', function (t) {
d.on('package', function (pkg_) {
t.deepEqual(pkg_, pkg);
});
- d.end(__dirname + '/pkg/main.js');
+ d.end(path.join(__dirname, '/pkg/main.js'));
d.resume();
});
diff --git a/test/pkg_filter.js b/test/pkg_filter.js
index e86eaed..497863b 100644
--- a/test/pkg_filter.js
+++ b/test/pkg_filter.js
@@ -3,6 +3,7 @@ var test = require('tape');
var JSONStream = require('JSONStream');
var packer = require('browser-pack');
var concat = require('concat-stream');
+var path = require('path');
test('pkg filter', function (t) {
t.plan(3);
@@ -14,7 +15,7 @@ test('pkg filter', function (t) {
return pkg;
}
});
- p.end(__dirname + '/files/pkg_filter/test.js');
+ p.end(path.join(__dirname, '/files/pkg_filter/test.js'));
var pack = packer();
p.pipe(JSONStream.stringify()).pipe(pack);
diff --git a/test/source.js b/test/source.js
index 4e3c167..bb6f074 100644
--- a/test/source.js
+++ b/test/source.js
@@ -1,12 +1,13 @@
var parser = require('../');
var test = require('tape');
var fs = require('fs');
+var path = require('path');
var files = {
- main: __dirname + '/files/main.js',
- foo: __dirname + '/files/foo.js',
- bar: __dirname + '/files/bar.js',
- extra: __dirname + '/files/extra.js'
+ main: path.join(__dirname, '/files/main.js'),
+ foo: path.join(__dirname, '/files/foo.js'),
+ bar: path.join(__dirname, '/files/bar.js'),
+ extra: path.join(__dirname, '/files/extra.js')
};
var sources = {
foo: fs.readFileSync(files.foo, 'utf8'),
diff --git a/test/tr_2dep_module.js b/test/tr_2dep_module.js
index 8204f30..f14614d 100644
--- a/test/tr_2dep_module.js
+++ b/test/tr_2dep_module.js
@@ -2,6 +2,7 @@ var mdeps = require('../');
var test = require('tape');
var JSONStream = require('JSONStream');
var packer = require('browser-pack');
+var path = require('path');
test('transform', function (t) {
t.plan(3);
@@ -9,7 +10,7 @@ test('transform', function (t) {
transform: [ 'insert-aaa', 'insert-bbb' ],
transformKey: [ 'browserify', 'transform' ]
});
- p.end(__dirname + '/files/tr_2dep_module/main.js');
+ p.end(path.join(__dirname, '/files/tr_2dep_module/main.js'));
var pack = packer();
p.pipe(JSONStream.stringify()).pipe(pack);
diff --git a/test/tr_err.js b/test/tr_err.js
index 842eec2..c6dd15d 100644
--- a/test/tr_err.js
+++ b/test/tr_err.js
@@ -3,6 +3,7 @@ var test = require('tape');
var JSONStream = require('JSONStream');
var packer = require('browser-pack');
var through = require('through');
+var path = require('path');
test('transform', function (t) {
t.plan(1);
@@ -14,7 +15,7 @@ test('transform', function (t) {
}
});
p.on('error', function (err) {
- t.ok(/tr_sh\/main\.js/.test(err));
+ t.ok(/tr_sh[\\\/]main\.js/.test(err));
});
- p.end(__dirname + '/files/tr_sh/main.js');
+ p.end(path.join(__dirname, '/files/tr_sh/main.js'));
});
diff --git a/test/tr_fn.js b/test/tr_fn.js
index 2c54e0a..68767f8 100644
--- a/test/tr_fn.js
+++ b/test/tr_fn.js
@@ -3,6 +3,7 @@ var test = require('tape');
var JSONStream = require('JSONStream');
var packer = require('browser-pack');
var through = require('through');
+var path = require('path');
test('transform', function (t) {
t.plan(3);
@@ -17,7 +18,7 @@ test('transform', function (t) {
},
transformKey: [ 'browserify', 'transform' ]
});
- p.end(__dirname + '/files/tr_sh/main.js');
+ p.end(path.join(__dirname, '/files/tr_sh/main.js'));
var pack = packer();
p.pipe(JSONStream.stringify()).pipe(pack);
diff --git a/test/tr_global.js b/test/tr_global.js
index f68f096..eed1534 100644
--- a/test/tr_global.js
+++ b/test/tr_global.js
@@ -3,6 +3,7 @@ var test = require('tape');
var JSONStream = require('JSONStream');
var packer = require('browser-pack');
var concat = require('concat-stream');
+var path = require('path');
test('global transforms', function (t) {
t.plan(1);
@@ -10,12 +11,12 @@ test('global transforms', function (t) {
var p = mdeps({
transform: [ 'tr-c', 'tr-d' ],
globalTransform: [
- __dirname + '/files/tr_global/node_modules/tr-e',
- __dirname + '/files/tr_global/node_modules/tr-f'
+ path.join(__dirname, '/files/tr_global/node_modules/tr-e'),
+ path.join(__dirname, '/files/tr_global/node_modules/tr-f')
],
transformKey: [ 'browserify', 'transform' ]
});
- p.end(__dirname + '/files/tr_global/main.js');
+ p.end(path.join(__dirname, '/files/tr_global/main.js'));
var pack = packer();
p.pipe(JSONStream.stringify()).pipe(pack).pipe(concat(function (src) {
diff --git a/test/tr_module.js b/test/tr_module.js
index 525cd52..cc51004 100644
--- a/test/tr_module.js
+++ b/test/tr_module.js
@@ -2,6 +2,7 @@ var mdeps = require('../');
var test = require('tape');
var JSONStream = require('JSONStream');
var packer = require('browser-pack');
+var path = require('path');
test('transform', function (t) {
t.plan(4);
@@ -9,7 +10,7 @@ test('transform', function (t) {
transform: [ 'insert-aaa', 'insert-bbb' ],
transformKey: [ 'browserify', 'transform' ]
});
- p.end(__dirname + '/files/tr_module/main.js');
+ p.end(path.join(__dirname, '/files/tr_module/main.js'));
var pack = packer();
p.pipe(JSONStream.stringify()).pipe(pack);
diff --git a/test/tr_opts.js b/test/tr_opts.js
index 698c858..7f738e3 100644
--- a/test/tr_opts.js
+++ b/test/tr_opts.js
@@ -3,13 +3,14 @@ var test = require('tape');
var JSONStream = require('JSONStream');
var packer = require('browser-pack');
var concat = require('concat-stream');
+var path = require('path');
test('transform options', function (t) {
t.plan(1);
var p = mdeps({
transformKey: [ 'mdtr' ]
});
- p.end(__dirname + '/tr_opts/main.js');
+ p.end(path.join(__dirname, '/tr_opts/main.js'));
var pack = packer();
p.pipe(JSONStream.stringify()).pipe(pack).pipe(concat(function (src) {
diff --git a/test/tr_rel.js b/test/tr_rel.js
index dbe1fd6..17947fa 100644
--- a/test/tr_rel.js
+++ b/test/tr_rel.js
@@ -2,13 +2,14 @@ var mdeps = require('../');
var test = require('tape');
var JSONStream = require('JSONStream');
var packer = require('browser-pack');
+var path = require('path');
test('transform', function (t) {
t.plan(1);
var p = mdeps({
transformKey: [ 'browserify', 'transform' ]
});
- p.end(__dirname + '/files/tr_rel/subdir/main.js');
+ p.end(path.join(__dirname, '/files/tr_rel/subdir/main.js'));
var pack = packer();
p.pipe(JSONStream.stringify()).pipe(pack);
diff --git a/test/tr_sh.js b/test/tr_sh.js
index 42ad55f..341236f 100644
--- a/test/tr_sh.js
+++ b/test/tr_sh.js
@@ -2,6 +2,7 @@ var mdeps = require('../');
var test = require('tape');
var JSONStream = require('JSONStream');
var packer = require('browser-pack');
+var path = require('path');
test('transform', function (t) {
t.plan(3);
@@ -9,7 +10,7 @@ test('transform', function (t) {
transform: [ './tr_a.js', './tr_b.js' ],
transformKey: [ 'browserify', 'transform' ]
});
- p.end(__dirname + '/files/tr_sh/main.js');
+ p.end(path.join(__dirname, '/files/tr_sh/main.js'));
var pack = packer();
p.pipe(JSONStream.stringify()).pipe(pack);
diff --git a/test/tr_whole_package.js b/test/tr_whole_package.js
index f3db796..564b51e 100644
--- a/test/tr_whole_package.js
+++ b/test/tr_whole_package.js
@@ -2,13 +2,14 @@ var mdeps = require('../');
var test = require('tape');
var JSONStream = require('JSONStream');
var packer = require('browser-pack');
+var path = require('path');
test('transform', function (t) {
t.plan(1);
var p = mdeps({
transformKey: [ 'browserify', 'transform' ]
});
- p.end(__dirname + '/files/tr_whole_package/main.js');
+ p.end(path.join(__dirname, '/files/tr_whole_package/main.js'));
var pack = packer();
p.pipe(JSONStream.stringify()).pipe(pack);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-module-deps.git
More information about the Pkg-javascript-commits
mailing list