-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into Test-Python-v3.12-beta
- Loading branch information
Showing
16 changed files
with
1,902 additions
and
1,917 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,8 +11,8 @@ | |
"bindings", | ||
"gyp" | ||
], | ||
"version": "9.3.1", | ||
"installVersion": 10, | ||
"version": "9.4.0", | ||
"installVersion": 11, | ||
"author": "Nathan Rajlich <[email protected]> (http://tootallnate.net)", | ||
"repository": { | ||
"type": "git", | ||
|
@@ -39,13 +39,13 @@ | |
}, | ||
"devDependencies": { | ||
"bindings": "^1.5.0", | ||
"mocha": "^10.2.0", | ||
"nan": "^2.14.2", | ||
"require-inject": "^1.4.4", | ||
"standard": "^14.3.4", | ||
"tap": "^12.7.0" | ||
"standard": "^14.3.4" | ||
}, | ||
"scripts": { | ||
"lint": "standard */*.js test/**/*.js", | ||
"test": "npm run lint && tap --timeout=1200 test/test-*" | ||
"test": "npm run lint && mocha --reporter=test/reporter.js test/test-download.js test/test-*" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
const Mocha = require('mocha') | ||
|
||
class Reporter { | ||
constructor (runner) { | ||
this.failedTests = [] | ||
|
||
runner.on(Mocha.Runner.constants.EVENT_RUN_BEGIN, () => { | ||
console.log('Starting tests') | ||
}) | ||
|
||
runner.on(Mocha.Runner.constants.EVENT_RUN_END, () => { | ||
console.log('Tests finished') | ||
console.log() | ||
console.log('****************') | ||
console.log('* TESTS REPORT *') | ||
console.log('****************') | ||
console.log() | ||
console.log(`Executed ${runner.stats.suites} suites with ${runner.stats.tests} tests in ${runner.stats.duration} ms`) | ||
console.log(` Passed: ${runner.stats.passes}`) | ||
console.log(` Skipped: ${runner.stats.pending}`) | ||
console.log(` Failed: ${runner.stats.failures}`) | ||
if (this.failedTests.length > 0) { | ||
console.log() | ||
console.log(' Failed test details') | ||
this.failedTests.forEach((failedTest, index) => { | ||
console.log() | ||
console.log(` ${index + 1}.'${failedTest.test.fullTitle()}'`) | ||
console.log(` Name: ${failedTest.error.name}`) | ||
console.log(` Message: ${failedTest.error.message}`) | ||
console.log(` Code: ${failedTest.error.code}`) | ||
console.log(` Stack: ${failedTest.error.stack}`) | ||
}) | ||
} | ||
console.log() | ||
}) | ||
|
||
runner.on(Mocha.Runner.constants.EVENT_SUITE_BEGIN, (suite) => { | ||
if (suite.root) { | ||
return | ||
} | ||
console.log(`Starting suite '${suite.title}'`) | ||
}) | ||
|
||
runner.on(Mocha.Runner.constants.EVENT_SUITE_END, (suite) => { | ||
if (suite.root) { | ||
return | ||
} | ||
console.log(`Suite '${suite.title}' finished`) | ||
console.log() | ||
}) | ||
|
||
runner.on(Mocha.Runner.constants.EVENT_TEST_BEGIN, (test) => { | ||
console.log(`Starting test '${test.title}'`) | ||
}) | ||
|
||
runner.on(Mocha.Runner.constants.EVENT_TEST_PASS, (test) => { | ||
console.log(`Test '${test.title}' passed in ${test.duration} ms`) | ||
}) | ||
|
||
runner.on(Mocha.Runner.constants.EVENT_TEST_PENDING, (test) => { | ||
console.log(`Test '${test.title}' skipped in ${test.duration} ms`) | ||
}) | ||
|
||
runner.on(Mocha.Runner.constants.EVENT_TEST_FAIL, (test, error) => { | ||
this.failedTests.push({ test, error }) | ||
console.log(`Test '${test.title}' failed in ${test.duration} ms with ${error}`) | ||
}) | ||
|
||
runner.on(Mocha.Runner.constants.EVENT_TEST_END, (test) => { | ||
console.log() | ||
}) | ||
} | ||
} | ||
|
||
module.exports = Reporter |
Oops, something went wrong.