Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace useColors -> colors #42

Merged
merged 1 commit into from
Sep 29, 2020

Conversation

luiz
Copy link
Contributor

@luiz luiz commented Mar 9, 2020

This PR contains:

  • bugfix
  • feature
  • refactor
  • tests
  • documentation
  • metadata

Breaking Changes?

  • yes
  • no

If yes, please describe the breakage.

Please Describe Your Changes

Uses option colors instead of useColors with mocha, removing a deprecation warning issued when running tests with mocha-chrome in other projects (screenshot below shows an example).

Screenshot with deprecation warning being shown at the top

@nathanboktae
Copy link
Contributor

LGTM!

@sluukkonen
Copy link

useColors has been removed in mocha 8, so currently mocha-chrome throws the following kind of exception with it.

[chrome-exception] {
  timestamp: 1599162811322.0051,
  exceptionDetails: {
    exceptionId: 2,
    text: 'Uncaught',
    lineNumber: 25927,
    columnNumber: 16,
    url: 'http://localhost:9990/node_modules/mocha/mocha.js',
    stackTrace: { callFrames: [Array] },
    exception: {
      type: 'object',
      subtype: 'error',
      className: 'TypeError',
      description: 'TypeError: self[opt] is not a function\n' +
        '    at http://localhost:9990/node_modules/mocha/mocha.js:25928:17\n' +
        '    at Array.forEach (<anonymous>)\n' +
        '    at Mocha.mocha$1.setup (http://localhost:9990/node_modules/mocha/mocha.js:25926:7)\n' +
        '    at set (<anonymous>:18:13)\n' +
        '    at http://localhost:9990/node_modules/mocha/mocha.js:25980:23\n' +
        '    at http://localhost:9990/node_modules/mocha/mocha.js:4:92\n' +
        '    at http://localhost:9990/node_modules/mocha/mocha.js:5:2',
      objectId: '{"injectedScriptId":2,"id":3}',
      preview: [Object]
    },
    executionContextId: 2
  }
}

@shellscape shellscape force-pushed the master branch 3 times, most recently from 2132076 to 647cbdb Compare September 26, 2020 13:28
@shellscape shellscape merged commit 1ce9356 into shellscape:master Sep 29, 2020
@shellscape
Copy link
Owner

thanks!

@twpol
Copy link

twpol commented Jan 4, 2021

All the changes here seem to be useColors --> colors, however, the screenshot at the top of the Mocha message and my local testing indicates it should have been useColors --> color (note the lack of s on the end).

Because of this, the code still does not work with Mocha 8.

@shellscape
Copy link
Owner

Please feel free to open a PR and show where the error is in the messaging you reference.

@sluukkonen
Copy link

Whatever the correct spelling is, mocha-chrome needs a new release.

@ppg ppg mentioned this pull request Jul 17, 2021
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants