Skip to content

Commit

Permalink
fix an error was thrown in afterAll TypeError
Browse files Browse the repository at this point in the history
  • Loading branch information
armanozak committed Jan 19, 2021
1 parent b3a67e0 commit 764e20a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { clearPage, CoreTestingModule, wait } from '@abp/ng.core/testing';
import { ThemeBasicTestingModule } from '@abp/ng.theme.basic/testing';
import { ThemeSharedTestingModule } from '@abp/ng.theme.shared/testing';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ComponentFixture } from '@angular/core/testing';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import {
AuthorDto,
Expand Down Expand Up @@ -57,7 +57,11 @@ const deleteAuthorSpy = jasmine.createSpy().and.callFake((id: string) => {
return of(null);
});

const getAuthor = (id: string) => items$.pipe(map(items => items.find(item => item.id === id)));
const getAuthor = (id: string) =>
items$.pipe(
map(items => items.find(item => item.id === id)),
take(1)
);

describe('AuthorComponent', () => {
let component: AuthorComponent;
Expand Down Expand Up @@ -96,10 +100,6 @@ describe('AuthorComponent', () => {
clearPage(fixture);
});

afterAll(() => {
TestBed.resetTestingModule();
});

it('should be created', () => {
expect(component).toBeTruthy();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { PagedAndSortedResultRequestDto } from '@abp/ng.core';
import { clearPage, CoreTestingModule, wait } from '@abp/ng.core/testing';
import { ThemeBasicTestingModule } from '@abp/ng.theme.basic/testing';
import { ThemeSharedTestingModule } from '@abp/ng.theme.shared/testing';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ComponentFixture } from '@angular/core/testing';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import { AuthorDto } from '@proxy/authors';
import { BookDto, BookService, BookType, CreateUpdateBookDto } from '@proxy/books';
Expand Down Expand Up @@ -69,7 +69,11 @@ const deleteBookSpy = jasmine.createSpy().and.callFake((id: string) => {
return of(null);
});

const getBook = (id: string) => items$.pipe(map(items => items.find(item => item.id === id)));
const getBook = (id: string) =>
items$.pipe(
map(items => items.find(item => item.id === id)),
take(1)
);

describe('BookComponent', () => {
let component: BookComponent;
Expand Down Expand Up @@ -119,10 +123,6 @@ describe('BookComponent', () => {
clearPage(fixture);
});

afterAll(() => {
TestBed.resetTestingModule();
});

it('should be created', () => {
expect(component).toBeTruthy();
});
Expand Down

0 comments on commit 764e20a

Please sign in to comment.