From f8dbaf0d148d58402637ec265e2b44ff53cb7d20 Mon Sep 17 00:00:00 2001 From: kreuzerk Date: Thu, 19 Nov 2020 16:37:28 +0100 Subject: [PATCH] =?UTF-8?q?chore:=20=F0=9F=A4=96=20fix=20failing=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 3 +-- projects/ng-sortgrid/src/lib/ngsg-item.directive.spec.ts | 6 +----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index aff2325..e595c15 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "format:check": "prettier --list-different 'projects/**/*.ts'", "format:write": "prettier --write 'projects/**/*.ts'", "import-conductor": "import-conductor --source 'projects/**/*.ts'", - "test": "ng test", + "test": "npm run test:lib", "test:coverage": "ng test --code-coverage --watch=false", "test:lib": "jest --config ./projects/ng-sortgrid/jest.config.js", "test:lib:coverage": "jest --config ./projects/ng-sortgrid/jest.config.js --coverage", @@ -74,7 +74,6 @@ }, "lint-staged": { "{src,__mocks__,bin}/**/*.ts": [ - "import-conductor --staged", "prettier --write", "git add" ] diff --git a/projects/ng-sortgrid/src/lib/ngsg-item.directive.spec.ts b/projects/ng-sortgrid/src/lib/ngsg-item.directive.spec.ts index f7cd05b..0a36406 100644 --- a/projects/ng-sortgrid/src/lib/ngsg-item.directive.spec.ts +++ b/projects/ng-sortgrid/src/lib/ngsg-item.directive.spec.ts @@ -1,11 +1,7 @@ import { NgsgElementsHelper } from './helpers/element/ngsg-elements.helper'; -import { NgsgSelectionService } from './mutliselect/ngsg-selection.service'; import { NgsgItemDirective } from './ngsg-item.directive'; import { NgsgEventsService } from './shared/ngsg-events.service'; import { NgsgOrderChange } from './shared/ngsg-order-change.model'; -import { NgsgReflectService } from './sort/reflection/ngsg-reflect.service'; -import { NgsgSortService } from './sort/sort/ngsg-sort.service'; -import { NgsgStoreService } from './store/ngsg-store.service'; describe('NgsgItemDirective', () => { let sut: NgsgItemDirective; @@ -101,7 +97,7 @@ describe('NgsgItemDirective', () => { }); it('must call event preventDefault', () => { - const preventDefaultSpy = createSpy(); + const preventDefaultSpy = jest.fn(); const event = { preventDefault: preventDefaultSpy }; sut.dragOver(event); expect(preventDefaultSpy).toHaveBeenCalled();