D
D
Drovosek012021-07-22 13:43:51
Angular
Drovosek01, 2021-07-22 13:43:51

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".

spoiler
60f94b3e286f1573504332.png


In package.json, the command "test" simply executes "ng test"

Here is the code of the current test file
spoiler
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');
    })
  );
});


Actually, what does "No tests found, exiting with code 0" mean and how to remove it?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question