Skip to content

utils pushToMethods invokes getters #3282

@ogiexela

Description

@ogiexela

if (!isFunction(obj[prop]) && !isAsyncFunction(obj[prop])) return;

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;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions