File tree Expand file tree Collapse file tree
packages/integration-tests-next/fixtures Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { describe , expect , it } from "vitest" ;
22import * as ts from "typescript" ;
3- import { join } from "node:path" ;
3+ import { isAbsolute , join , relative } from "node:path" ;
44import { fileURLToPath } from "node:url" ;
55import { createRequire } from "node:module" ;
66
@@ -20,8 +20,11 @@ export default defineConfig({
2020function assertFixtureViteVersion ( fixtureDir : string , expectedMajor : string ) : void {
2121 const requireFromFixture = createRequire ( join ( fixtureDir , "package.json" ) ) ;
2222 const vitePackageJsonPath = requireFromFixture . resolve ( "vite/package.json" ) ;
23+ const relativeVitePackageJsonPath = relative ( fixtureDir , vitePackageJsonPath ) ;
2324
24- expect ( vitePackageJsonPath ) . toContain ( `${ fixtureDir } /node_modules/` ) ;
25+ expect ( isAbsolute ( relativeVitePackageJsonPath ) ) . toBe ( false ) ;
26+ expect ( relativeVitePackageJsonPath . startsWith ( ".." ) ) . toBe ( false ) ;
27+ expect ( relativeVitePackageJsonPath . split ( / [ \\ / ] / ) [ 0 ] ) . toBe ( "node_modules" ) ;
2528
2629 const vitePackageJson = requireFromFixture ( "vite/package.json" ) as { version : string } ;
2730 expect ( vitePackageJson . version . split ( "." ) [ 0 ] ) . toBe ( expectedMajor ) ;
You can’t perform that action at this time.
0 commit comments