Skip to content

Using Object.defineProperty on prototypes causes the tests to fail to build #155

Open
@FutureAstroMiner

Description

@FutureAstroMiner

Using Object.defineProperty like:

Object.defineProperty(Creep.prototype, 'boosts', {
	get() {
		if (!this._boosts) {
			this._boosts = _.compact(_.unique(_.map(this.body as BodyPartDefinition[], bodyPart => bodyPart.boost)));
		}
		return this._boosts;
	},
	configurable: true,
});

and importing this into the main file causes the test to fail to build with a reference error
ReferenceError: Creep is not defined

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions