-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
type: buga defect, confirmed by a maintainera defect, confirmed by a maintainer
Description
Prerequisites
- [x ] Checked that your issue hasn't already been filed by cross-referencing issues with the
faq
label - [x ] Checked next-gen ES issues and syntax problems by using the same environment and/or transpiler configuration without Mocha to ensure it isn't just a feature that actually isn't supported in the environment in question or a bug in your code.
- [x ] 'Smoke tested' the code to be tested by running it outside the real test suite to get a better sense of whether the problem is in the code under test, your usage of Mocha, or Mocha itself
- [x ] Ensured that there is no discrepancy between the locally and globally installed versions of Mocha. You can find them with:
node node_modules/.bin/mocha --version
(Local) andmocha --version
(Global). We recommend avoiding the use of globally installed Mocha.
Description
Issue #3243 shipped with v6.0.0 throw a deprecation warning or an error if --throw-deprecation
is enabled with all CoffeeScript tests since the language support implicit returns.
Steps to Reproduce
The following minimalist test case:
describe 'My Suite', () ->
it 'run a test', () ->
console.log 'yes'
Throw the error "DeprecationWarning: Suites ignore return values. Suite "My Suite" in /package/test/my/test.coffee returned a value; this may be a bug in your test code"
A temporary workaround include returning undefined
:
describe 'system.authconfig', () ->
it 'fuck around', () ->
console.log 'yes'
undefined
Versions
- The output of
npx mocha --version
: 6.0.0 - The code transpiler being used: CoffeeScript
- Other information not relevant
Additional Information
I understand the motivation behind #3243. One way to please everyone is to detect if the return value found in the suite is not the same as the one returned by it
.
jakesjewsjleedev
Metadata
Metadata
Assignees
Labels
type: buga defect, confirmed by a maintainera defect, confirmed by a maintainer