codeceptjs / CodeceptJS

Supercharged End 2 End Testing Framework for NodeJS
http://codecept.io
MIT License
4.11k stars 723 forks source link

utils pushToMethods invokes getters #3282

Open ogiexela opened 2 years ago

ogiexela commented 2 years ago

https://github.com/codeceptjs/CodeceptJS/blob/29c9fc942ae43996da2c469308afbb8b99ceeda1/lib/utils.js#L82

This should check if the property is a getter before trying to access it otherwise the getter gets invoked twice here.

const Helper = require('@codeceptjs/helper');

class MyHelper extends Helper {

  get foo() {
    console.log('bar')
  }

}

module.exports = MyHelper;
github-actions[bot] commented 10 months ago

This issue is stale because it has been open for 90 days with no activity.