From 3a2726726c1f73c6cb4ba4286f8ea6c5480b85ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Myeongjae=20Kim=20=E1=84=80=E1=85=B5=E1=86=B7=E1=84=86?= =?UTF-8?q?=E1=85=A7=E1=86=BC=E1=84=8C=E1=85=A2?= Date: Mon, 28 Oct 2019 11:59:19 +0900 Subject: [PATCH] [#22] Pass to tests except tsx --- jest.config.js | 3 -- package-lock.json | 46 +++++++++++++++++++ .../service/NoticeServiceImpl.unit.test.ts | 10 ++-- 3 files changed, 51 insertions(+), 8 deletions(-) diff --git a/jest.config.js b/jest.config.js index 7752d4b..b1cece2 100644 --- a/jest.config.js +++ b/jest.config.js @@ -169,9 +169,6 @@ module.exports = { // A map from regular expressions to paths to transformers // transform: null, - transform: { - '^.+\\.tsx?$': 'babel-jest', - }, // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation // transformIgnorePatterns: [ diff --git a/package-lock.json b/package-lock.json index a01a9a1..e7e3007 100644 --- a/package-lock.json +++ b/package-lock.json @@ -291,6 +291,43 @@ "@babel/plugin-syntax-async-generators": "^7.2.0" } }, + "@babel/plugin-proposal-class-properties": { + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.5.5.tgz", + "integrity": "sha512-AF79FsnWFxjlaosgdi421vmYG6/jg79bVD0dpD44QdgobzHKuLZ6S3vl8la9qIeSwGi8i1fS0O1mfuDAAdo1/A==", + "dev": true, + "requires": { + "@babel/helper-create-class-features-plugin": "^7.5.5", + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-proposal-decorators": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.6.0.tgz", + "integrity": "sha512-ZSyYw9trQI50sES6YxREXKu+4b7MAg6Qx2cvyDDYjP2Hpzd3FleOUwC9cqn1+za8d0A2ZU8SHujxFao956efUg==", + "dev": true, + "requires": { + "@babel/helper-create-class-features-plugin": "^7.6.0", + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-syntax-decorators": "^7.2.0" + }, + "dependencies": { + "@babel/helper-create-class-features-plugin": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.6.0.tgz", + "integrity": "sha512-O1QWBko4fzGju6VoVvrZg0RROCVifcLxiApnGP3OWfWzvxRZFCoBD81K5ur5e3bVY2Vf/5rIJm8cqPKn8HUJng==", + "dev": true, + "requires": { + "@babel/helper-function-name": "^7.1.0", + "@babel/helper-member-expression-to-functions": "^7.5.5", + "@babel/helper-optimise-call-expression": "^7.0.0", + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-replace-supers": "^7.5.5", + "@babel/helper-split-export-declaration": "^7.4.4" + } + } + } + }, "@babel/plugin-proposal-json-strings": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.2.0.tgz", @@ -336,6 +373,15 @@ "@babel/helper-plugin-utils": "^7.0.0" } }, + "@babel/plugin-syntax-decorators": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-decorators/-/plugin-syntax-decorators-7.2.0.tgz", + "integrity": "sha512-38QdqVoXdHUQfTpZo3rQwqQdWtCn5tMv4uV6r2RMfTqNBuv4ZBhz79SfaQWKTVmxHjeFv/DnXVC/+agHCklYWA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, "@babel/plugin-syntax-dynamic-import": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.2.0.tgz", diff --git a/src/mother/notice/tests/infrastructure/service/NoticeServiceImpl.unit.test.ts b/src/mother/notice/tests/infrastructure/service/NoticeServiceImpl.unit.test.ts index a5910e0..5cfd70f 100644 --- a/src/mother/notice/tests/infrastructure/service/NoticeServiceImpl.unit.test.ts +++ b/src/mother/notice/tests/infrastructure/service/NoticeServiceImpl.unit.test.ts @@ -1,10 +1,10 @@ +import NoticeRequestDto from "src/mother/notice/api/dto/NoticeRequestDto"; +import NoticeRepository from "src/mother/notice/domain/repository/NoticeRepository"; import { noticeService } from "src/mother/notice/infrastructure/service/NoticeServiceImpl"; -import NoticeRequestDto from "../../../api/dto/NoticeRequestDto"; -import NoticeRepository from "../../../domain/repository/NoticeRepository"; import { getNoticeFixture } from "../model/Notice.unit.test"; -import { noticeRepository } from "../../../infrastructure/repository/NoticeRepositoryImpl"; -jest.mock("../../infrastructure/repository/NoticeRepositoryImpl") +import { noticeRepository } from "src/mother/notice/infrastructure/repository/NoticeRepositoryImpl"; +jest.mock("src/mother/notice/infrastructure/repository/NoticeRepositoryImpl") describe("NoticeServiceImpl test", () => { const mockNoticeRepository = noticeRepository as jest.Mocked; @@ -14,7 +14,7 @@ describe("NoticeServiceImpl test", () => { (mockNoticeRepository.findById as jest.Mock).mockResolvedValue(getNoticeFixture()); const id = 1 - // when + // whn const notice = await noticeService.getNotice(id); // then