Skip to content

Commit c106e91

Browse files
committed
Update test
1 parent 0ecdc68 commit c106e91

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

packages/vscode-container-client/src/test/PodmanClient.test.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Licensed under the MIT License. See LICENSE in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6+
import * as fs from 'fs';
67
import * as path from 'path';
78
import * as stream from 'stream';
89
import { describe, it } from 'mocha';
@@ -21,8 +22,21 @@ const executeInWsl = true; // Change this to false to run the tests on the host
2122

2223
const client = new PodmanClient();
2324
let runner: ShellStreamCommandRunnerFactory<ShellStreamCommandRunnerOptions> | WslShellCommandRunnerFactory;
25+
26+
const dockerfileContent = `
27+
FROM alpine:latest
28+
29+
EXPOSE 8080
30+
`;
31+
2432
let testDockerfileContext: string = path.resolve(__dirname, 'buildContext');
2533
let testDockerfile: string = path.resolve(testDockerfileContext, 'Dockerfile');
34+
35+
// Create the build context directory if it doesn't exist
36+
fs.mkdirSync(testDockerfileContext, { recursive: true });
37+
// Write the Dockerfile to the build context directory
38+
fs.writeFileSync(testDockerfile, dockerfileContent);
39+
2640
if (executeInWsl) {
2741
runner = new WslShellCommandRunnerFactory({ strict: true });
2842
testDockerfileContext = wslifyPath(testDockerfileContext);

0 commit comments

Comments
 (0)