Skip to content

Commit

Permalink
use path matcher in unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
BioPhoton committed Oct 22, 2024
1 parent 54c634a commit 1bd48db
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ describe('runBootstrapExecutor', () => {
expect(runExecutorSpy).toHaveBeenCalledWith(
stopVerdaccioTask,
{
filePath: `tmp/environments/${e2eProjectName}/verdaccio-registry.json`,
filePath: expect.toMatchPath(
`tmp/environments/${e2eProjectName}/verdaccio-registry.json`
),
verbose: true,
},
context
Expand All @@ -122,7 +124,9 @@ describe('runBootstrapExecutor', () => {
expect(runExecutorSpy).toHaveBeenCalledWith(
stopVerdaccioTask,
{
filePath: `${environmentRoot}/verdaccio-registry.json`,
filePath: expect.toMatchPath(
`${environmentRoot}/verdaccio-registry.json`
),
},
context
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ describe('runSetupEnvironmentExecutor', () => {
target: TARGET_ENVIRONMENT_VERDACCIO_STOP,
},
{
filePath: 'tmp/environments/my-lib-e2e/verdaccio-registry.json',
filePath: expect.toMatchPath(
'tmp/environments/my-lib-e2e/verdaccio-registry.json'
),
verbose: undefined,
},
context
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ describe('runKillProcessExecutor', () => {
await expect(
runKillProcessExecutor(
{
filePath: 'tmp/environments/my-lib',
filePath: expect.toMatchPath('tmp/environments/my-lib'),
},
{
root: 'tmp/environments/test',
Expand Down
1 change: 1 addition & 0 deletions testing/test-setup/src/lib/fs.mock.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { type MockInstance, afterEach, beforeEach, vi } from 'vitest';
import { MEMFS_VOLUME } from '@push-based/test-utils';
import './extend/path-matcher';

vi.mock('fs', async () => {
const memfs: typeof import('memfs') = await vi.importActual('memfs');
Expand Down

0 comments on commit 1bd48db

Please sign in to comment.