mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-08 21:07:46 +00:00
[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:
@@ -1,13 +1,12 @@
|
||||
import frameworkList from '@vercel/frameworks';
|
||||
import { detectFramework } from '../src';
|
||||
import { FixtureFilesystem } from './utils/fixture-filesystem';
|
||||
import { detectFramework, LocalFileSystemDetector } from '../src';
|
||||
import { getExamples } from '../../../examples/__tests__/test-utils';
|
||||
|
||||
describe('examples should be detected', () => {
|
||||
it.each(getExamples())(
|
||||
'should detect $exampleName',
|
||||
async ({ exampleName, examplePath }) => {
|
||||
const fs = new FixtureFilesystem(examplePath);
|
||||
const fs = new LocalFileSystemDetector(examplePath);
|
||||
const framework = await detectFramework({ fs, frameworkList });
|
||||
if (!framework) {
|
||||
throw new Error(`Framework not detected for example "${exampleName}".`);
|
||||
|
||||
Reference in New Issue
Block a user