11import { describe , expect , it } from 'vitest'
2- import { getTypesPackageName , parseNodeModulesPath , parsePackageSpecifier } from './deps.ts'
2+ import {
3+ getTypesPackageName ,
4+ parseNodeModulesPath ,
5+ parsePackageSpecifier ,
6+ } from './deps.ts'
37
48describe ( 'parsePackageSpecifier' , ( ) => {
59 it ( 'parses a simple package name' , ( ) => {
@@ -31,15 +35,15 @@ describe('parsePackageSpecifier', () => {
3135
3236describe ( 'parseNodeModulesPath' , ( ) => {
3337 it ( 'returns undefined for paths without node_modules' , ( ) => {
34- expect ( parseNodeModulesPath ( '/project/project/src/index.ts' ) ) . toBeUndefined ( )
38+ expect (
39+ parseNodeModulesPath ( '/project/project/src/index.ts' ) ,
40+ ) . toBeUndefined ( )
3541 } )
3642
3743 it ( 'parses a simple package in node_modules' , ( ) => {
38- expect ( parseNodeModulesPath ( '/project/node_modules/lodash/index.js' ) ) . toEqual ( [
39- 'lodash' ,
40- '/index.js' ,
41- '/project/node_modules/lodash' ,
42- ] )
44+ expect (
45+ parseNodeModulesPath ( '/project/node_modules/lodash/index.js' ) ,
46+ ) . toEqual ( [ 'lodash' , '/index.js' , '/project/node_modules/lodash' ] )
4347 } )
4448
4549 it ( 'parses a scoped package in node_modules' , ( ) => {
@@ -54,7 +58,9 @@ describe('parseNodeModulesPath', () => {
5458
5559 it ( 'uses the last node_modules segment for nested deps' , ( ) => {
5660 expect (
57- parseNodeModulesPath ( '/project/node_modules/foo/node_modules/bar/lib/utils.js' ) ,
61+ parseNodeModulesPath (
62+ '/project/node_modules/foo/node_modules/bar/lib/utils.js' ,
63+ ) ,
5864 ) . toEqual ( [
5965 'bar' ,
6066 '/lib/utils.js' ,
0 commit comments