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

fix to work SpyOn in Jasmine #1

Merged
merged 1 commit into from
Mar 19, 2019

Conversation

knight9999
Copy link

@knight9999 knight9999 commented Mar 19, 2019

Platforms affected

All platforms. But tests only

What does this PR do?

At the Cordova-Common 3.1.0, the logger[level] property becomes not writable. (level = results, verbose, normal, warn, info, error)
Then we can't use SpyOn for logger[level] in jasmine tests.

Actually npm run tests fails like

    Error: <spyOn> : results is not declared writable or has no setter
    Usage: spyOn(<object>, <methodName>)

To resolve this issue, this PR overrides CordovaLogger.prototype.addLevel method in test code (i.e. cli.spec.js) to make logger[level] property writable.

What testing has been done on this change?

npm run test

Checklist

  • Reported an issue in the JIRA database
  • Commit message follows the format: "CB-3232: (android) Fix bug with resolving file paths", where CB-xxxx is the JIRA ID & "android" is the platform affected.
  • Added automated test coverage as appropriate for this change.

@erisu erisu merged commit f626923 into erisu:cordova9-prep Mar 19, 2019
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.

3 participants