mocha-list-tests
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -143,2 +143,15 @@ // ----------------------------------------------------------------------------- | ||
// ----------------------------------------------------------------------------- | ||
// captureHookFunctions | ||
// | ||
// Helper function to captures all 'before' 'after' ,... calls and add them to | ||
// our internal list of tests. Since these function's first parameter is a | ||
// function itself, we have to specify the name beforehand | ||
// ----------------------------------------------------------------------------- | ||
function captureHookFunctions (name) { | ||
return function capture (ignoreFunction) { | ||
console.log (name, ignoreFunction); | ||
addTestRouteToTree (testRoute, ':' + name); | ||
}; | ||
} | ||
// ----------------------------------------------------------------------------- | ||
// findSuitesAndTests | ||
@@ -167,2 +180,7 @@ // | ||
global.before = captureHookFunctions('before') | ||
global.after = captureHookFunctions('after') | ||
global.beforeEach = captureHookFunctions('beforeEach') | ||
global.afterEach = captureHookFunctions('afterEach') | ||
// capture all suites and direct tests | ||
@@ -169,0 +187,0 @@ for (let i = 0; i < allTestFiles.length; i++) { |
{ | ||
"name": "mocha-list-tests", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "List mocha suites and tests without running anything", | ||
@@ -5,0 +5,0 @@ "main": "mocha-list-tests.js", |
# mocha-list-tests | ||
List all mocha suites and tests without running them. | ||
List all mocha suites and tests without running them. Zero dependencies. | ||
@@ -9,3 +9,3 @@ This is a standalone mocha-compatible companion, with no dependencies (not even mocha), to get a parseable json list of all suites and tests that would be executed in a folder. | ||
This script would be useful as long as this functionality is not included in mocha itself. At the time of this writing (2018), there seems to be no motivation to do so, since a patch was submitted in the past and rejected. | ||
This script would be useful as long as this functionality is not included in mocha itself. At the time of this writing (2019), there seems to be no motivation to do so, since a patch was submitted in the past and rejected. | ||
@@ -12,0 +12,0 @@ ## Install |
@@ -18,2 +18,15 @@ | ||
}); | ||
}); | ||
describe ('suite-3', async function () { | ||
before( function(){ console.log("won't execute"); }); | ||
after( function(){ console.log("won't execute"); }); | ||
beforeEach( function(){ console.log("won't execute"); }); | ||
afterEach( function(){ console.log("won't execute"); }); | ||
it('test-3.1', async function() { | ||
console.log ("won't execute"); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11938
235