I'd like to check button disable state after each it funtion. So I use afterEach function but error like below was occured.
How to call describe or it function in afterEach function or any workarround.
'it' should only be used in 'describe' function
describe('Input Error Check', () => {
const fixture = TestBed.createComponent(AppComponent);
afterEach( () => {
const searchButon = fixture.debugElement.query(By.css('#searchButton')).nativeElement as HTMLButtonElement
expect(searchButon.disabled).toBeTruthy()
})
it('No Input Value', () =>{
// write test code
})
it('Invalid Input Value', () =>{
// write test code
})
})