From cd3fd3649b84ed52674fdf6a86783c9e8526d0c6 Mon Sep 17 00:00:00 2001 From: m-mitsuhide Date: Fri, 29 May 2020 13:51:55 +0900 Subject: [PATCH] fix: index.spec.ts --- __tests__/index.spec.ts | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/__tests__/index.spec.ts b/__tests__/index.spec.ts index 4d4d596..264bae8 100644 --- a/__tests__/index.spec.ts +++ b/__tests__/index.spec.ts @@ -2,19 +2,14 @@ import fs from 'fs' import build from '../src/buildTemplate' import getConfig from '../src/getConfig' -const basePath = 'packages/pathpida' - describe('cli test', () => { test('main', () => { - const { input, output, baseURL, trailingSlash } = getConfig(`${basePath}/pathpida.config.js`)[0] - const inputDir = `${basePath}/${input}` - const outputDir = `${basePath}/${output}` + const { input, output, baseURL, trailingSlash } = getConfig()[0] - const resultFilePath = `${outputDir}$path.ts` - const result = fs.readFileSync(resultFilePath, 'utf8') - const { filePath, text } = build({ input: inputDir, output: outputDir, baseURL, trailingSlash }) + const result = fs.readFileSync('$path.ts', 'utf8') + const { filePath, text } = build({ input, output, baseURL, trailingSlash }) - expect(filePath).toBe(resultFilePath) + expect(filePath).toBe('$path.ts') expect(text).toBe(result) }) })