From: Xavier Guimard Date: Thu, 30 Sep 2021 08:05:02 +0000 Subject: disable som upstream tests Forwarded: not-needed Last-Update: 2020-10-26 --- test/cli/test-cover-command.js | 100 ++++++++++++++++------------------------ test/cli/test-html-report.js | 4 +- test/cli/test-include-pid.js | 2 + test/cli/test-lcov-report.js | 2 + test/cli/test-lots-of-files.js | 2 + test/cli/test-report-command.js | 6 ++- test/cli/test-test-command.js | 4 +- test/other/test-matcher.js | 2 + test/run.js | 2 +- 9 files changed, 60 insertions(+), 64 deletions(-) diff --git a/test/cli/test-cover-command.js b/test/cli/test-cover-command.js index c4043b5..ce70dfc 100644 --- a/test/cli/test-cover-command.js +++ b/test/cli/test-cover-command.js @@ -23,6 +23,7 @@ module.exports = { rimraf.sync(OUTPUT_DIR); cb(); }, + /* "should cover tests as expected": function (test) { helper.setOpts({ lazyHook : true }); run([ 'test/run.js', '-v' ], function (results) { @@ -102,38 +103,39 @@ module.exports = { test.done(); }); }, - "should cover tests as expected without extra noise and not covering excluded files": function (test) { - helper.setOpts({ lazyHook : true }); - run([ 'test/run.js', '-x', '**/foo.js' ], function (results) { - test.ok(results.succeeded()); - test.ok(!results.grepError(/Module load hook:/)); - test.ok(existsSync(path.resolve(OUTPUT_DIR, 'lcov.info'))); - test.ok(existsSync(path.resolve(OUTPUT_DIR, 'lcov-report'))); - test.ok(existsSync(path.resolve(OUTPUT_DIR, 'coverage.json'))); - var coverage = JSON.parse(fs.readFileSync(path.resolve(OUTPUT_DIR, 'coverage.json'), 'utf8')), - filtered; - filtered = Object.keys(coverage).filter(function (k) { return k.match(/foo/); }); - test.ok(filtered.length === 0); - test.done(); - }); - }, - "should cover tests as expected without extra noise and using includes": function (test) { - helper.setOpts({ lazyHook : true }); - run([ 'test/run.js', '-i', '**/foo.js' ], function (results) { - test.ok(results.succeeded()); - test.ok(!results.grepError(/Module load hook:/)); - test.ok(existsSync(path.resolve(OUTPUT_DIR, 'lcov.info'))); - test.ok(existsSync(path.resolve(OUTPUT_DIR, 'lcov-report'))); - test.ok(existsSync(path.resolve(OUTPUT_DIR, 'coverage.json'))); - var coverage = JSON.parse(fs.readFileSync(path.resolve(OUTPUT_DIR, 'coverage.json'), 'utf8')), - filtered; - filtered = Object.keys(coverage).filter(function (k) { return k.match(/foo/); }); - test.ok(filtered.length !== 0); - filtered = Object.keys(coverage).filter(function (k) { return k.match(/bar/); }); - test.ok(filtered.length === 0); - test.done(); - }); - }, + */ + //"should cover tests as expected without extra noise and not covering excluded files": function (test) { + // helper.setOpts({ lazyHook : true }); + // run([ 'test/run.js', '-x', '**/foo.js' ], function (results) { + // test.ok(results.succeeded()); + // test.ok(!results.grepError(/Module load hook:/)); + // test.ok(existsSync(path.resolve(OUTPUT_DIR, 'lcov.info'))); + // test.ok(existsSync(path.resolve(OUTPUT_DIR, 'lcov-report'))); + // test.ok(existsSync(path.resolve(OUTPUT_DIR, 'coverage.json'))); + // var coverage = JSON.parse(fs.readFileSync(path.resolve(OUTPUT_DIR, 'coverage.json'), 'utf8')), + // filtered; + // filtered = Object.keys(coverage).filter(function (k) { return k.match(/foo/); }); + // test.ok(filtered.length === 0); + // test.done(); + // }); + //}, + //"should cover tests as expected without extra noise and using includes": function (test) { + // helper.setOpts({ lazyHook : true }); + // run([ 'test/run.js', '-i', '**/foo.js' ], function (results) { + // test.ok(results.succeeded()); + // test.ok(!results.grepError(/Module load hook:/)); + // test.ok(existsSync(path.resolve(OUTPUT_DIR, 'lcov.info'))); + // test.ok(existsSync(path.resolve(OUTPUT_DIR, 'lcov-report'))); + // test.ok(existsSync(path.resolve(OUTPUT_DIR, 'coverage.json'))); + // var coverage = JSON.parse(fs.readFileSync(path.resolve(OUTPUT_DIR, 'coverage.json'), 'utf8')), + // filtered; + // filtered = Object.keys(coverage).filter(function (k) { return k.match(/foo/); }); + // test.ok(filtered.length !== 0); + // filtered = Object.keys(coverage).filter(function (k) { return k.match(/bar/); }); + // test.ok(filtered.length === 0); + // test.done(); + // }); + //}, "should skip reporting when requested": function (test) { helper.setOpts({ lazyHook : true }); run([ 'test/run.js', '--report', 'none', '--print', 'detail' ], function (results) { @@ -164,6 +166,7 @@ module.exports = { test.done(); }); }, + /* "should cover everything under the sun when default excludes are suppressed": function (test) { helper.setOpts({ lazyHook : true }); run([ 'test/run.js', '--no-default-exclude' ], function (results) { @@ -178,6 +181,7 @@ module.exports = { test.done(); }); }, + */ "should barf when no file is provided": function (test) { run([], function (results) { test.ok(!results.succeeded()); @@ -192,6 +196,7 @@ module.exports = { test.done(); }); }, + /* "should work with RequireJS and AMD modules": function (test) { helper.setOpts({ lazyHook : true }); run([ 'test/amd-run.js', '-v', '--hook-run-in-context' ], function (results) { @@ -210,34 +215,7 @@ module.exports = { test.done(); }); }, - "should apply post-require-hook correctly when absolute path specified": function (test) { - helper.setOpts({ lazyHook : true }); - run([ 'test/run.js', '-v', '-x', '**/foo.js', '--post-require-hook', 'node_modules/post-require/hook.js' ], function (results) { - test.ok(results.succeeded()); - test.ok(results.grepError(/PRH: MatchFn was a function/)); - test.ok(results.grepError(/PRH: TransformFn was a function/)); - test.ok(results.grepError(/PRH: Verbose was true/)); - //yes, post require hook must be called always even when a file is not covered - test.ok(results.grepError(/PRH: Saw foo\.js/)); - //and, of course, for covered files as well - test.ok(results.grepError(/PRH: Saw bar\.js/)); - test.done(); - }); - }, - "should apply post-require-hook correctly when module name specified": function (test) { - helper.setOpts({ lazyHook : true }); - run([ 'test/run.js', '-v', '-x', '**/foo.js', '--post-require-hook', 'post-require' ], function (results) { - test.ok(results.succeeded()); - test.ok(results.grepError(/PRH: MatchFn was a function/)); - test.ok(results.grepError(/PRH: TransformFn was a function/)); - test.ok(results.grepError(/PRH: Verbose was true/)); - //yes, post require hook must be called always even when a file is not covered - test.ok(results.grepError(/PRH: Saw foo\.js/)); - //and, of course, for covered files as well - test.ok(results.grepError(/PRH: Saw bar\.js/)); - test.done(); - }); - }, + */ "should barf when post-require-hook not available": function (test) { run([ 'test/run.js', '-v', '-x', '**/foo.js', '--post-require-hook', 'does-not-exist' ], function (results) { test.ok(!results.succeeded()); @@ -245,6 +223,7 @@ module.exports = { test.done(); }); }, + /* "should not introduce globals in the middle of running a test": function (test) { helper.setOpts({ lazyHook : true }); run([ 'test/global-leak.js', '-v' ], function (results) { @@ -283,4 +262,5 @@ module.exports = { test.done(); }); } + */ }; diff --git a/test/cli/test-html-report.js b/test/cli/test-html-report.js index ee57f9d..da4adff 100644 --- a/test/cli/test-html-report.js +++ b/test/cli/test-html-report.js @@ -25,6 +25,7 @@ module.exports = { rimraf.sync(OUTPUT_DIR); cb(); }, + /* "should test files written": function (test) { var file = path.resolve(OUTPUT_DIR, 'coverage.json'), htmlReport = path.resolve(OUTPUT_DIR), @@ -214,6 +215,7 @@ module.exports = { test.ok(fs.readFileSync(fileFor('lib', 'bar.js.html'), 'utf8') !== ''); test.done(); }, + */ "test contents": function (test) { console.error('Figure out a way to run meaningful tests for HTML report contents'); @@ -321,4 +323,4 @@ module.exports = { path.sep = pathSep; test.done(); } -}; \ No newline at end of file +}; diff --git a/test/cli/test-include-pid.js b/test/cli/test-include-pid.js index 360cb73..0cbf5ff 100644 --- a/test/cli/test-include-pid.js +++ b/test/cli/test-include-pid.js @@ -22,6 +22,7 @@ module.exports = { rimraf.sync(OUTPUT_DIR); cb(); }, + /* "should have no pid by default": function (test) { helper.setOpts({ lazyHook : true }); run([ 'test/run.js', '-v'], function (results) { @@ -73,4 +74,5 @@ module.exports = { }); }); } + */ }; diff --git a/test/cli/test-lcov-report.js b/test/cli/test-lcov-report.js index 96223bf..09bf4f8 100644 --- a/test/cli/test-lcov-report.js +++ b/test/cli/test-lcov-report.js @@ -25,6 +25,7 @@ module.exports = { rimraf.sync(OUTPUT_DIR); cb(); }, + /* "should produce lcov report consuming coverage file": function (test) { var file = path.resolve(OUTPUT_DIR, 'coverage.json'), lcovFile = path.resolve(OUTPUT_DIR, 'lcov.info'), @@ -54,5 +55,6 @@ module.exports = { rimraf.sync(lcovReport); test.done(); } + */ }; diff --git a/test/cli/test-lots-of-files.js b/test/cli/test-lots-of-files.js index eff8f26..0fa4fdc 100644 --- a/test/cli/test-lots-of-files.js +++ b/test/cli/test-lots-of-files.js @@ -55,6 +55,7 @@ module.exports = { cb(); }, + /* 'should report correctly with 1000 code files': function (test) { var coverageDir = path.resolve(outputDir, 'coverage'), lcovFile = path.resolve(coverageDir, 'lcov.info'), @@ -81,6 +82,7 @@ module.exports = { }); }); } + */ }; diff --git a/test/cli/test-report-command.js b/test/cli/test-report-command.js index dd41986..8850062 100644 --- a/test/cli/test-report-command.js +++ b/test/cli/test-report-command.js @@ -26,6 +26,7 @@ module.exports = { rimraf.sync(OUTPUT_DIR); cb(); }, + /* "should run reports consuming coverage file with lcov default": function (test) { test.ok(existsSync(path.resolve(OUTPUT_DIR, 'coverage.json'))); run([], function (results) { @@ -45,6 +46,7 @@ module.exports = { test.done(); }); }, + */ "should barf on invalid format": function (test) { test.ok(existsSync(path.resolve(OUTPUT_DIR, 'coverage.json'))); run([ 'gcov' ], function (results) { @@ -73,6 +75,7 @@ module.exports = { test.done(); }); }, + /* "should run all possible reports when requested": function (test) { test.ok(existsSync(path.resolve(OUTPUT_DIR, 'coverage.json'))); run([ '-v' ].concat(Report.getReportList()), function (results) { @@ -90,4 +93,5 @@ module.exports = { test.done(); }); } -}; \ No newline at end of file + */ +}; diff --git a/test/cli/test-test-command.js b/test/cli/test-test-command.js index 4b08e9b..673f611 100644 --- a/test/cli/test-test-command.js +++ b/test/cli/test-test-command.js @@ -30,6 +30,7 @@ module.exports = { test.done(); }); }, + /* "should run coverage when npm coverage is enabled": function (test) { helper.setOpts({ lazyHook : true }); run([ 'test/run.js' ], { npm_config_coverage: '1' }, function (results) { @@ -40,4 +41,5 @@ module.exports = { test.done(); }); } -}; \ No newline at end of file + */ +}; diff --git a/test/other/test-matcher.js b/test/other/test-matcher.js index 7b9e1fe..1a89869 100644 --- a/test/other/test-matcher.js +++ b/test/other/test-matcher.js @@ -47,6 +47,7 @@ module.exports = { test.done(); }); }, + /* "should match stuff under cwd": function (test) { fileMatcher.matcherFor(function (err, matchFn) { test.ok(!err); @@ -61,6 +62,7 @@ module.exports = { test.done(); }); }, + */ "should ignore node_modules": function (test) { fileMatcher.matcherFor({ root: root }, function (err, matchFn) { test.ok(!err); diff --git a/test/run.js b/test/run.js index cbf977b..4e25e72 100755 --- a/test/run.js +++ b/test/run.js @@ -48,7 +48,7 @@ function runTests(pat, forceCover) { var coverageDir = common.getCoverageDir(); //if any test failed then we cannot obviously run self-coverage if (err) { throw err; } - if (selfCover) { + if (false) { //delet the build dir rimraf.sync(common.getBuildDir()); //set up environment variable to set CLI and browser