Coder Social home page Coder Social logo

idlejs's People

Contributors

harunurhan avatar msftenhanceprovenance avatar pamfilos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

idlejs's Issues

idlejs does not work with Jest (https://jestjs.io/)

Our Angular application uses Jest for unit testing, and we found out that idlejs library does not work with Jest. See errors below:

● Test suite failed to run

Jest encountered an unexpected token

This usually means that you are trying to import a file which Jest cannot parse, e.g. it's not plain JavaScript.

By default, if Jest sees a Babel config, it will use that to transform your files, ignoring "node_modules".

Here's what you can do:
 • To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
 • If you need a custom transformation specify a "transform" option in your config.
 • If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.

You'll find more details and examples of these config options in the docs:
https://jestjs.io/docs/en/configuration.html

Details:

C:\dev\src\trunk\my-apps\node_modules\idlejs\dist\index.js:1
export { Idle } from './idle';
^^^^^^

SyntaxError: Unexpected token 'export'

>  8 | import {Idle, NotIdle} from 'idlejs/dist';
     | ^
   9 | 
  10 | @Injectable({
  11 |   providedIn: 'root'

  at Runtime._execModule (../../node_modules/jest-runtime/build/index.js:1179:56)

Working Fine in Desktop , but not in Mobile Devices

i tried to check the idle timer in my webapp , it is working in Desktop but when i try to access the same in the mobile devices , the idle timer is not working .
Steps:
Log in to my web App in my mobile (Chrome Browser)
Push it to Background app
Lock my mobile device
Come back after 15 mins to check , if i see a modal about User Inactive.
Result: I could not see any dialog box. Is the timer is working ?.. Can u please help me

Here is my Code To check the Idle Timer :
const TouchDeviceIdle = new Idle()
.whenNot([
{
events: ['touchcancel','touchmove','touchstart','focus','focusin'],
target: document,
},
])
.whenNotInteractive()
.within(15)
.do(() => {
if(this.sessionModalShow){
TouchDeviceIdle.stop();
}else{
this.userInactive(TouchDeviceIdle);
}
})
.start(); */

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.