Check install in tool directory with folder name

This commit is contained in:
Zachary Eisinger 2020-07-16 21:14:02 -07:00
parent f87d15e234
commit 082a8866f9

View File

@ -140,9 +140,7 @@ describe('installer tests', () => {
} }
}, 400000); //This needs some time to download on "slower" internet connections }, 400000); //This needs some time to download on "slower" internet connections
it('Acquires version of dotnet if no matching version is installed', async () => { it('Acquires version of dotnet from global.json if no matching version is installed', async () => {
const dotnetDir = path.join(toolDir, 'dncs', '2.2.105', os.arch());
const globalJsonPath = path.join(process.cwd(), 'global.json'); const globalJsonPath = path.join(process.cwd(), 'global.json');
const jsonContents = `{${os.EOL}"sdk": {${os.EOL}"version": "2.2.105"${os.EOL}}${os.EOL}}`; const jsonContents = `{${os.EOL}"sdk": {${os.EOL}"version": "2.2.105"${os.EOL}}${os.EOL}}`;
if (!fs.existsSync(globalJsonPath)) { if (!fs.existsSync(globalJsonPath)) {
@ -150,11 +148,11 @@ describe('installer tests', () => {
} }
await setup.run(); await setup.run();
expect(fs.existsSync(`${dotnetDir}.complete`)).toBe(true); expect(fs.existsSync(path.join(toolDir, 'sdk', '2.2.105'))).toBe(true);
if (IS_WINDOWS) { if (IS_WINDOWS) {
expect(fs.existsSync(path.join(dotnetDir, 'dotnet.exe'))).toBe(true); expect(fs.existsSync(path.join(toolDir, 'dotnet.exe'))).toBe(true);
} else { } else {
expect(fs.existsSync(path.join(dotnetDir, 'dotnet'))).toBe(true); expect(fs.existsSync(path.join(toolDir, 'dotnet'))).toBe(true);
} }
fs.unlinkSync(globalJsonPath); fs.unlinkSync(globalJsonPath);
}, 100000); }, 100000);