[fs-detectors] Use LocalFileSystemDetector instead of FixtureFilesystem (#10100)

The code for these two are almost identical, so consolidate into one codebase.

Also adjusts the `pnpm test` script to allow for specifying a file name to be executed, instead of running all tests.
This commit is contained in:
Nathan Rajlich
2023-06-13 16:30:00 -07:00
committed by GitHub
parent d61a1a7988
commit 42c0b32a8d
13 changed files with 50 additions and 87 deletions

View File

@@ -1,6 +1,9 @@
import path from 'path';
import { packageManagers, detectFramework } from '../src';
import { FixtureFilesystem } from './utils/fixture-filesystem';
import {
packageManagers,
detectFramework,
LocalFileSystemDetector,
} from '../src';
describe('package-managers', () => {
describe.each([
@@ -16,7 +19,7 @@ describe('package-managers', () => {
it(testName, async () => {
const fixture = path.join(__dirname, 'fixtures', fixturePath);
const fs = new FixtureFilesystem(fixture);
const fs = new LocalFileSystemDetector(fixture);
const result = await detectFramework({
fs,