Say I have a class like this:
import {bindable} from 'aurelia-framework';
export default class MyClass {
@bindable text = null;
bind() {
this.message = `Message: ${this.text}`;
}
}
And in my test code, I have the following code:
import MyClass from '../../src/myclass';
describe('MyClass', () => {
let sut;
beforeEach(() => sut = new MyClass());
describe('bind', () => {
beforeEach(() => {
sut.text = "my text";
sut.bind();
});
it('should have a message', () => {
expect(sut.message).toBe('Message: my text');
});
});
});
When I run this test, I raise the following error:
TypeError: Cannot read the 'getOrCreateObserversLookup' property from undefined at getObserver (C: / Users / vinte / Documents / projects / mealcal / jspm_packages / github / aurelia / templating@0.15.1 /aurelia-templating.js: 2571: 40) on MyClass.descriptor.set [as text] (C: / Users / vinte / Documents / projects / mealcal / jspm_packages / github / aurelia / templating@0.15.1 /aurelia-templating.js: 2628: 9) in the object. (C: /Users/vinte/Documents/projects/mealcal/test/unit/myclass.spec.js: 26: 16)
, , , bindable.
?