Answer the question
In order to leave comments, you need to log in
Jest what does "No tests found, exiting with code 0" mean and how to remove it?
There is a project on Angular 11.
I write tests on jest. I need to find out the test results of one file and it's easier for me to run the test file manually when I finish writing to some logical end, so I run the test through the terminal with the command yarn test --test-file autocomplete-adapter.spec.ts
The problem is that many lines appear with the text "No tests found, exiting" with code 0".
import { fakeAsync, tick, waitForAsync } from '@angular/core/testing';
import { FormControl } from '@angular/forms';
import { of } from 'rxjs';
import { delay } from 'rxjs/operators';
import { AutocompleteAdapter } from './autocomplete-adapter';
describe('AutocompleteAdapter', () => {
it('Должен быть создан класс', () => {
const component = new AutocompleteAdapter(undefined);
expect(component).toBeTruthy();
});
it(
'Должно вернуть значение запроса',
waitForAsync(() => {
const callBack = () => of(['test']);
const component = new AutocompleteAdapter(callBack);
const control = new FormControl();
expect(component).toBeTruthy();
component.getResponseValueFromRequest(control).subscribe((response) => {
console.log('response', response);
// expect(response).toBeTruthy();
// expect(response).toBe('[test]');
});
control.setValue('lala');
})
);
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question