Skip to content

Commit e2a4fbf

Browse files
committed
Fix path tests
1 parent 4a5f73e commit e2a4fbf

3 files changed

Lines changed: 10 additions & 13 deletions

File tree

.run/test_integration_dev -- $FilePathRelativeToProjectRoot$.run.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<component name="ProjectRunConfigurationManager">
2-
<configuration default="false" name="test:integration:dev -- $FilePathRelativeToProjectRoot$" type="js.build_tools.npm" nameIsGenerated="true">
2+
<configuration default="false" name="test:integration:dev -- $FilePathRelativeToProjectRoot$" type="js.build_tools.npm">
33
<package-json value="$PROJECT_DIR$/package.json" />
44
<command value="run" />
55
<scripts>

src/resources/shell/path/path-resource.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,6 @@ export class PathResource extends Resource<PathConfig> {
9494
}
9595

9696
override async refresh(parameters: Partial<PathConfig>, context: RefreshContext<PathConfig>): Promise<Partial<PathConfig> | null> {
97-
console.log('My shell', process.env.SHELL);
98-
console.log('Other shell method', os.userInfo().shell)
99-
10097
// If declarations only, we only look into files to find potential paths
10198
if (parameters.declarationsOnly || context.isStateful) {
10299
const pathsResult = new Set<string>();

test/shell/path.test.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ describe('Path resource integration tests', async () => {
1818
}
1919
], {
2020
validateApply: async () => {
21-
expect((await testSpawn(TestUtils.getShellCommand('echo $PATH'))).data).to.include(tempDir1);
21+
expect((await testSpawn('echo $PATH', { interactive: true })).data).to.include(tempDir1);
2222
},
2323
validateDestroy: async () => {
24-
expect((await testSpawn(TestUtils.getShellCommand('echo $PATH'))).data).to.not.include(tempDir1);
24+
expect((await testSpawn('echo $PATH', { interactive: true })).data).to.not.include(tempDir1);
2525
}
2626
});
2727
})
@@ -40,12 +40,12 @@ describe('Path resource integration tests', async () => {
4040
console.log(JSON.stringify(plan, null, 2));
4141
},
4242
validateApply: async () => {
43-
const { data: path } = await testSpawn('echo $PATH');
43+
const { data: path } = await testSpawn('echo $PATH', { interactive: true })
4444
expect(path).to.include(tempDir1);
4545
expect(path).to.include(tempDir2);
4646
},
4747
validateDestroy: async () => {
48-
const { data: path } = await testSpawn('echo $PATH')
48+
const { data: path } = await testSpawn('echo $PATH', { interactive: true })
4949
expect(path).to.not.include(tempDir1);
5050
expect(path).to.not.include(tempDir2);
5151
}
@@ -64,12 +64,12 @@ describe('Path resource integration tests', async () => {
6464
}
6565
], {
6666
validateApply: async () => {
67-
const { data: path } = await testSpawn('echo $PATH')
67+
const { data: path } = await testSpawn('echo $PATH', { interactive: true })
6868
expect(path).to.include(tempDir1);
6969
expect(path).to.include(tempDir2);
7070
},
7171
validateDestroy: async () => {
72-
const { data: path } = await testSpawn('echo $PATH')
72+
const { data: path } = await testSpawn('echo $PATH', { interactive: true })
7373
expect(path).to.not.include(tempDir1);
7474
expect(path).to.not.include(tempDir2);
7575
}
@@ -90,7 +90,7 @@ describe('Path resource integration tests', async () => {
9090
}
9191
], {
9292
validateApply: async () => {
93-
const { data: path } = await testSpawn('echo $PATH');
93+
const { data: path } = await testSpawn('echo $PATH', { interactive: true })
9494
expect(path).to.include(tempDir1);
9595
expect(path).to.include(tempDir2);
9696
},
@@ -111,15 +111,15 @@ describe('Path resource integration tests', async () => {
111111
})])
112112
})
113113

114-
const { data: path } = await testSpawn('echo $PATH');
114+
const { data: path } = await testSpawn('echo $PATH', { interactive: true })
115115
expect(path).to.include(tempDir1);
116116
expect(path).to.include(tempDir2);
117117
expect(path).to.include(tempDir3);
118118
expect(path).to.include(tempDir4);
119119
}
120120
},
121121
validateDestroy: async () => {
122-
const { data: path } = await testSpawn('echo $PATH');
122+
const { data: path } = await testSpawn('echo $PATH', { interactive: true })
123123
expect(path).to.not.include(tempDir1);
124124
expect(path).to.not.include(tempDir2);
125125
expect(path).to.not.include(tempDir3);

0 commit comments

Comments
 (0)