Skip to content

Commit 45d1300

Browse files
committed
Revert "chore: wip"
This reverts commit 3024439. chore: wip chore: wip
1 parent 6e09f48 commit 45d1300

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

test/plugin-architecture.test.ts

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,16 @@ describe('Integration Ecosystem & Plugin Architecture', () => {
99
let pluginManager: PluginManager
1010
let mockContext: SetupContext
1111
let originalEnv: Record<string, string | undefined>
12+
let originalCwd: string
1213

1314
beforeEach(() => {
15+
// Store original working directory
16+
originalCwd = process.cwd()
17+
18+
// Change to a temporary directory to avoid interference with project files
19+
const tempDir = fs.mkdtempSync(path.join(require('node:os').tmpdir(), 'plugin-test-'))
20+
process.chdir(tempDir)
21+
1422
pluginManager = new PluginManager()
1523
mockContext = {
1624
step: 'setup_complete',
@@ -73,7 +81,7 @@ describe('Integration Ecosystem & Plugin Architecture', () => {
7381
})
7482

7583
afterEach(() => {
76-
// Clean up test files
84+
// Clean up test files in temp directory
7785
if (fs.existsSync('.buddy')) {
7886
fs.rmSync('.buddy', { recursive: true, force: true })
7987
}
@@ -85,6 +93,15 @@ describe('Integration Ecosystem & Plugin Architecture', () => {
8593
fs.rmSync(file, { force: true })
8694
}
8795
})
96+
97+
// Restore original working directory and clean up temp directory
98+
const tempDir = process.cwd()
99+
process.chdir(originalCwd)
100+
try {
101+
fs.rmSync(tempDir, { recursive: true, force: true })
102+
} catch {
103+
// Ignore cleanup errors
104+
}
88105

89106
// Restore original environment variables
90107
if (originalEnv.SLACK_WEBHOOK_URL !== undefined) {
@@ -287,9 +304,9 @@ describe('Integration Ecosystem & Plugin Architecture', () => {
287304

288305
// Test the loadCustomPlugins method directly
289306
try {
290-
const directPlugins = await freshPluginManager.loadCustomPlugins()
307+
const directPlugins = await (freshPluginManager as any).loadCustomPlugins()
291308
console.log('Direct loadCustomPlugins result:', directPlugins.length)
292-
directPlugins.forEach(p => console.log(` Direct: ${p.name}`))
309+
directPlugins.forEach((p: any) => console.log(` Direct: ${p.name}`))
293310
}
294311
catch (err) {
295312
console.log('Direct loadCustomPlugins error:', err)

test/respect-latest.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ describe('respectLatest functionality', () => {
1111
let testDir: string
1212

1313
beforeEach(() => {
14-
// Create temporary test directory
15-
testDir = fs.mkdtempSync('buddy-test-')
14+
// Create temporary test directory in a more isolated location
15+
// eslint-disable-next-line ts/no-require-imports
16+
testDir = fs.mkdtempSync(path.join(require('node:os').tmpdir(), 'buddy-test-'))
1617
})
1718

1819
afterEach(() => {

0 commit comments

Comments
 (0)