mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-14 03:58:33 -05:00
Change configure Jupyter server steps from async to sync (#13937)
* change config steps to sync * fix tests * use pathexistsSync * remove pathExistsSync call * address PR comments
This commit is contained in:
@@ -55,17 +55,15 @@ describe('Jupyter server instance', function (): void {
|
||||
|
||||
it('Should create config and data directories on configure', async function (): Promise<void> {
|
||||
// Given a server instance
|
||||
let mkdirStub = sinon.stub(utils,'mkDir').withArgs(sinon.match.any,sinon.match.any).returns(Promise.resolve());
|
||||
let copyStub = sinon.stub(fs,'copy').returns();
|
||||
let pathStub = sinon.stub(utils,'exists').withArgs(sinon.match.any).returns(Promise.resolve(false));
|
||||
let ensureDirSyncStub = sinon.stub(utils,'ensureDirSync').withArgs(sinon.match.any,sinon.match.any).returns();
|
||||
let copyStub = sinon.stub(fs,'copySync').returns();
|
||||
|
||||
// When I run configure
|
||||
await serverInstance.configure();
|
||||
|
||||
// Then I expect a folder to have been created with config and data subdirs
|
||||
sinon.assert.callCount(mkdirStub,5);
|
||||
sinon.assert.callCount(ensureDirSyncStub,5);
|
||||
sinon.assert.callCount(copyStub,3);
|
||||
sinon.assert.callCount(pathStub,1);
|
||||
});
|
||||
|
||||
it('Should have URI info after start', async function (): Promise<void> {
|
||||
@@ -152,8 +150,8 @@ describe('Jupyter server instance', function (): void {
|
||||
|
||||
it('Should remove directory on close', async function (): Promise<void> {
|
||||
// Given configure and startup are done
|
||||
sinon.stub(utils,'mkDir').withArgs(sinon.match.any,sinon.match.any).returns(Promise.resolve());
|
||||
sinon.stub(fs,'copy').returns();
|
||||
sinon.stub(utils,'ensureDirSync').withArgs(sinon.match.any,sinon.match.any).returns();
|
||||
sinon.stub(fs,'copySync').returns();
|
||||
|
||||
let process = setupSpawn({
|
||||
sdtout: (listener: (msg: string) => void) => { },
|
||||
|
||||
Reference in New Issue
Block a user