refactor: merge context paths

This commit is contained in:
tiddlygit-test 2021-05-04 20:01:53 +08:00
parent fdb478dfaf
commit c9a34b8a8f
11 changed files with 29 additions and 34 deletions

View file

@ -1,14 +1,13 @@
/* eslint-disable unicorn/filename-case */
import { After, Before, Status } from '@cucumber/cucumber';
import fs from 'fs-extra';
import { temporarySettingPath, mockWikiPath } from './constants';
import { SETTINGS_FOLDER, DEFAULT_WIKI_FOLDER } from '../../src/constants/paths';
import { TiddlyGitWorld } from './world';
Before(async function () {
// clear setting folder
await fs.remove(temporarySettingPath);
await fs.remove(mockWikiPath);
await fs.remove(SETTINGS_FOLDER);
await fs.remove(DEFAULT_WIKI_FOLDER);
});
After(async function (this: TiddlyGitWorld, testCase) {

View file

@ -1,7 +0,0 @@
import path from 'path';
import { sourcePath } from '../../src/constants/paths';
import { developmentSettingFolderName, developmentWikiFolderName } from '../../src/constants/fileNames';
export const temporarySettingPath = path.resolve(sourcePath, '..', developmentSettingFolderName);
export const mockWikiPath = path.resolve(sourcePath, '..', developmentWikiFolderName);