From c0ef4bcbbe8cc5f267e18fcd87e54c50fde2bb19 Mon Sep 17 00:00:00 2001 From: "armslave.yy" Date: Tue, 22 Sep 2020 14:16:43 +0800 Subject: [PATCH] fix: ignore eslintrc in test-case MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 因为 test-case 中的 eslintrc 文件会被 xima 读取导致 commit hook 不通过。所以去掉了其内容,并在 run test 时配置 diff 方法不比较该文件。 Link: https://code.aone.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/codereview/3772464 * fix: ignore eslintrc in test-case --- packages/code-generator/test/rax-app.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/code-generator/test/rax-app.test.ts b/packages/code-generator/test/rax-app.test.ts index e3a05f61c..e4ad5565d 100644 --- a/packages/code-generator/test/rax-app.test.ts +++ b/packages/code-generator/test/rax-app.test.ts @@ -62,7 +62,7 @@ function runPrettierSync(files: string[], cwd: string) { } function diffActualAndExpectedSync(caseFullDir: string): string { - const res = spawnSync('diff', ['-wBur', 'expected', 'actual'], { + const res = spawnSync('diff', ['-wBur', '-x', '.eslintrc.js', 'expected', 'actual'], { cwd: caseFullDir, stdio: 'pipe', shell: true,