Skip to content

Commit 508c033

Browse files
committed
Add tests for dotnet install
1 parent da16995 commit 508c033

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

test/core/platform.test.ts

+62
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,26 @@ if (process.platform === "win32") {
387387
},
388388
},
389389
},
390+
{
391+
name: "Windows (dotnet)",
392+
platformDetails: {
393+
operatingSystem: platform.OperatingSystem.Windows,
394+
isOS64Bit: true,
395+
isProcess64Bit: true,
396+
},
397+
environmentVars: {
398+
"USERNAME": "test",
399+
"USERPROFILE": "C:\\Users\\test",
400+
},
401+
expectedPowerShellSequence: [
402+
{ exePath: "C:\\Users\\test\\tools\\pwsh.exe", displayName: ".NET Core PowerShell Global Tool", supportsProperArguments: false },
403+
],
404+
filesystem: {
405+
"C:\\Users\\test\\tools": {
406+
"pwsh.exe": "",
407+
},
408+
},
409+
},
390410
];
391411
} else {
392412
successTestCases = [
@@ -480,6 +500,46 @@ if (process.platform === "win32") {
480500
},
481501
},
482502
},
503+
{
504+
name: "MacOS (dotnet)",
505+
platformDetails: {
506+
operatingSystem: platform.OperatingSystem.MacOS,
507+
isOS64Bit: true,
508+
isProcess64Bit: true,
509+
},
510+
environmentVars: {
511+
"USER": "test",
512+
"HOME": "/Users/test",
513+
},
514+
expectedPowerShellSequence: [
515+
{ exePath: "/Users/test/.dotnet/tools/pwsh", displayName: ".NET Core PowerShell Global Tool", supportsProperArguments: false },
516+
],
517+
filesystem: {
518+
"/Users/test/.dotnet/tools": {
519+
pwsh: "",
520+
},
521+
},
522+
},
523+
{
524+
name: "Linux (dotnet)",
525+
platformDetails: {
526+
operatingSystem: platform.OperatingSystem.Linux,
527+
isOS64Bit: true,
528+
isProcess64Bit: true,
529+
},
530+
environmentVars: {
531+
"USER": "test",
532+
"HOME": "/home/test",
533+
},
534+
expectedPowerShellSequence: [
535+
{ exePath: "/home/test/.dotnet/tools/pwsh", displayName: ".NET Core PowerShell Global Tool", supportsProperArguments: false },
536+
],
537+
filesystem: {
538+
"/home/test/.dotnet/tools": {
539+
pwsh: "",
540+
},
541+
},
542+
},
483543
];
484544
}
485545

@@ -585,6 +645,7 @@ describe("Platform module", function () {
585645

586646
assert.strictEqual(defaultPowerShell.exePath, expectedPowerShell.exePath);
587647
assert.strictEqual(defaultPowerShell.displayName, expectedPowerShell.displayName);
648+
assert.strictEqual(defaultPowerShell.supportsProperArguments, expectedPowerShell.supportsProperArguments);
588649
});
589650
}
590651

@@ -620,6 +681,7 @@ describe("Platform module", function () {
620681

621682
assert.strictEqual(foundPowerShell && foundPowerShell.exePath, expectedPowerShell.exePath);
622683
assert.strictEqual(foundPowerShell && foundPowerShell.displayName, expectedPowerShell.displayName);
684+
assert.strictEqual(foundPowerShell && foundPowerShell.supportsProperArguments, expectedPowerShell.supportsProperArguments);
623685
}
624686

625687
assert.strictEqual(

0 commit comments

Comments
 (0)