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

How to disable usageStatistics in test environment? #259

Closed
YashkaSurin opened this issue Jan 18, 2019 · 6 comments
Closed

How to disable usageStatistics in test environment? #259

YashkaSurin opened this issue Jan 18, 2019 · 6 comments
Labels

Comments

@YashkaSurin
Copy link

Version

1.9.1

Development Environment

nodeJs, jest

Current Behavior

I'm using jest for testing. It breaks on importing tui calendar when trying to send statistics:

    TypeError: Cannot read property 'getItem' of undefined
      
      at Object.sendHostname (node_modules/tui-code-snippet/dist/tui-code-snippet.js:1708:37)
      at Object.<anonymous> (node_modules/tui-calendar/dist/tui-calendar.js:1498:10)
      at Object../src/index.js (node_modules/tui-calendar/dist/tui-calendar.js:1530:30)
      at __webpack_require__ (node_modules/tui-calendar/dist/tui-calendar.js:36:30)
      at node_modules/tui-calendar/dist/tui-calendar.js:100:18
      at node_modules/tui-calendar/dist/tui-calendar.js:103:10
      at webpackUniversalModuleDefinition (node_modules/tui-calendar/dist/tui-calendar.js:9:20)
      at Object.<anonymous> (node_modules/tui-calendar/dist/tui-calendar.js:16:3)

How can I prevent that? Setting global.tui.usageStatistics to false does not help.

@jungeun-cho
Copy link
Contributor

@YashkaSurin
We should support api which can disable usageStatistics.
I'm sorry for the inconvenience.
I'll try to respond as soon as possible.

@dongsik-yoo
Copy link
Contributor

@YashkaSurin Why don't you mock localStorage? jestjs/jest#2098

@YashkaSurin
Copy link
Author

@dongsik-yoo yes, that's what I came to in the end. I just thought there could be some way to do it using some component configuration that I had missed. Thanks.

@dongsik-yoo
Copy link
Contributor

@YashkaSurin Is it in progress? Thanks in advance.

@YashkaSurin
Copy link
Author

@dongsik-yoo mocking localStorage works for me.

@dongsik-yoo
Copy link
Contributor

@YashkaSurin Good! It's helpful when using jest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants