करने कोणीय उन्नयन मैं आज सुबह 2.3.1 के लिए एक कोणीय 2.1.0 परियोजना उन्नत बनाया के बाद से संपत्ति केवल पढ़ने के लिए आवंटित करने के लिए प्रयास किया गया, और तब से मेरी 86 परीक्षण के 5 निम्न त्रुटि के साथ विफल:2.3.1
Failed: Attempted to assign to readonly property. [email protected]:///~/@angular/core/src/facade/errors.js:43:33 <- src/test.ts:12465:52
यहाँ सबसे सरल परीक्षण है कि विफल हो रहा है है:
/* tslint:disable:no-unused-variable */
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
import {ProfileComponent} from './profile.component';
import {TranslateModule, TranslateService} from 'ng2-translate';
import {FormsModule} from '@angular/forms';
import {ProfileService} from '../profile.service';
import {ProfileServiceStub} from '../../../testing/profile-service-stub';
import {TranslateServiceStub} from '../../../testing/translate-service-stub';
import {NotificationsServiceStub} from '../../../testing/notifications-service-stub';
import {NotificationsService} from 'angular2-notifications';
describe('ProfileComponent',() => {
let component: ProfileComponent;
let fixture: ComponentFixture<ProfileComponent>;
const profileServiceStub = new ProfileServiceStub(5000);
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ProfileComponent],
imports: [
TranslateModule, FormsModule
],
providers: [
{provide: ProfileService, useValue: profileServiceStub},
{provide: TranslateService, useClass: TranslateServiceStub},
{provide: NotificationsService, useClass: NotificationsServiceStub}
]
}).compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ProfileComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create',() => {
expect(component).toBeTruthy();
});
});
मैं जिस तरह से परीक्षण की स्थापना की है में किसी भी संरचनात्मक अंतर दिखाई नहीं देता है, तो मुझे लगता है कि यह कुछ मैं कर रहा हूँ के साथ कुछ है।
और जब मैं errors.js पर एक नजर है, दोषी लाइन इस तरह दिखता है:
set: function (message) { this._nativeError.message = message; },
मैं वास्तव में है कि के समाधान के तरीकों पता नहीं है।
मेरे पास एक ही समस्या है। इस बात को डीबग करने के लिए कोई सुराग नहीं है। – Prathap