Fix paths for tests (#13816)

This commit is contained in:
Charles Gagnon
2020-12-15 16:04:36 -08:00
committed by GitHub
parent 9adffbb950
commit 4575f2bbe6
2 changed files with 7 additions and 5 deletions

View File

@@ -126,9 +126,10 @@ describe('PlatformService', () => {
it('openFile', () => {
const stub = sinon.stub(vscode.commands, 'executeCommand').resolves(); //resolves with a known string
platformService.openFile(filePath);
const expectedFilePath = vscode.Uri.file(filePath).fsPath;
stub.callCount.should.equal(1);
stub.getCall(0).args[0].should.equal('vscode.open');
stub.getCall(0).args[1].path.should.equal(filePath);
(stub.getCall(0).args[1] as vscode.Uri).fsPath.should.equal(expectedFilePath);
});
it('readTextFile', async () => {
sinon.stub(fs.promises, 'readFile').resolves(contents);