File tree Expand file tree Collapse file tree 5 files changed +16
-11
lines changed
Expand file tree Collapse file tree 5 files changed +16
-11
lines changed Original file line number Diff line number Diff line change 11import { temporaryDirectoryTask } from "tempy" ;
22import { expect , test } from "vitest" ;
3- import { changeDir , currentDir } from "./process" ;
4-
5- test ( "current directory" , ( ) => {
6- expect ( currentDir ( ) . isOk ( ) ) . toBe ( true ) ;
7- } ) ;
3+ import { changeDir } from "./change-dir" ;
84
95test ( "change directory" , async ( ) => {
106 await temporaryDirectoryTask ( async ( dir ) => {
Original file line number Diff line number Diff line change 1+ import { Result } from "neverthrow" ;
2+ import { OsError } from "./errors" ;
3+
4+ export const changeDir = Result . fromThrowable (
5+ process . chdir ,
6+ ( e ) => new OsError ( "failed to change directory" , { cause : e } ) ,
7+ ) ;
Original file line number Diff line number Diff line change 1+ import { expect , test } from "vitest" ;
2+ import { currentDir } from "./current-dir" ;
3+
4+ test ( "current directory" , ( ) => {
5+ expect ( currentDir ( ) . isOk ( ) ) . toBe ( true ) ;
6+ } ) ;
Original file line number Diff line number Diff line change @@ -5,8 +5,3 @@ export const currentDir = Result.fromThrowable(
55 process . cwd ,
66 ( e ) => new OsError ( "failed to get current directory" , { cause : e } ) ,
77) ;
8-
9- export const changeDir = Result . fromThrowable (
10- process . chdir ,
11- ( e ) => new OsError ( "failed to change directory" , { cause : e } ) ,
12- ) ;
Original file line number Diff line number Diff line change 11import { ResultAsync , ok , okAsync } from "neverthrow" ;
22import { performance } from "node:perf_hooks" ;
33import { join } from "pathe" ;
4+ import { changeDir } from "./change-dir" ;
45import { createProject } from "./create-project" ;
6+ import { currentDir } from "./current-dir" ;
57import type { ExtractorError } from "./errors" ;
68import type { ExtractedDeclaration } from "./extract-declarations" ;
79import { installPackage } from "./install-package" ;
@@ -10,7 +12,6 @@ import { packageJson } from "./package-json";
1012import { packageName } from "./package-name" ;
1113import { packageOverview } from "./package-overview" ;
1214import { packageTypes } from "./package-types" ;
13- import { changeDir , currentDir } from "./process" ;
1415import { tempDir } from "./temp-dir" ;
1516
1617/**
You can’t perform that action at this time.
0 commit comments