Skip to content

Commit

Permalink
[@osd/plugin-generator] Standardize paths in tests
Browse files Browse the repository at this point in the history
Signed-off-by: Miki <amoo_miki@yahoo.com>
  • Loading branch information
AMoo-Miki committed Oct 20, 2022
1 parent a92ad5f commit 3598b44
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,18 @@ import Path from 'path';

import del from 'del';
import execa from 'execa';
import { REPO_ROOT } from '@osd/utils';
import { REPO_ROOT, standardize } from '@osd/utils';
import { createAbsolutePathSerializer } from '@osd/dev-utils';
import globby from 'globby';

const GENERATED_DIR = Path.resolve(REPO_ROOT, `plugins`);
// Has to be a posix reference because it is used to generate glob patterns
const GENERATED_DIR = standardize(Path.resolve(REPO_ROOT, `plugins`), true);

expect.addSnapshotSerializer(createAbsolutePathSerializer());
expect.addSnapshotSerializer(
createAbsolutePathSerializer(
process?.platform === 'win32' ? standardize(REPO_ROOT, true) : REPO_ROOT
)
);

beforeEach(async () => {
await del([`${GENERATED_DIR}/**`, `!${GENERATED_DIR}`, `!${GENERATED_DIR}/.gitignore`], {
Expand Down

0 comments on commit 3598b44

Please sign in to comment.