Skip to content

Commit

Permalink
Remove unused process.chdir.
Browse files Browse the repository at this point in the history
  • Loading branch information
raineorshine committed Apr 25, 2024
1 parent c58decf commit 688c07f
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions test/getAllPackages.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ async function stripDir(dirPath: string, paths: [string[], string[]]): Promise<[
/** convenience function to call getAllPackages for a given test-path */
async function getAllPackagesForTest(testPath: string, options: Options): Promise<[string[], string[]]> {
const testCwd = path.join(__dirname, testPath).replace(/\\/g, '/')
process.chdir(testCwd) // FIXME: remove the setting of cwd, the tests should work without it
const optionsWithTestCwd: Options = { cwd: testCwd, ...options }
const [pkgInfos, workspacePackageNames]: [PackageInfo[], string[]] = await getAllPackages(optionsWithTestCwd)
const packagePaths: string[] = pkgInfos.map((packageInfo: PackageInfo) => packageInfo.filepath)
Expand All @@ -32,17 +31,6 @@ async function getAllPackagesForTest(testPath: string, options: Options): Promis
}

describe('getAllPackages', () => {
let originalCwd = process.cwd()
beforeEach(() => {
// FIXME: delete me
originalCwd = process.cwd()
})

afterEach(() => {
// FIXME: delete me
process.chdir(originalCwd)
})

it('returns default package without cwd', async () => {
const [pkgInfos, workspacePackageNames]: [PackageInfo[], string[]] = await getAllPackages({})
const packagePaths: string[] = pkgInfos.map((packageInfo: PackageInfo) => packageInfo.filepath)
Expand Down

0 comments on commit 688c07f

Please sign in to comment.