File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed
Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -35,11 +35,9 @@ export class Repository {
3535 policy : ConstructorPolicy
3636 ) {
3737 if ( policy === ConstructorPolicy . LateInit ) {
38- console . error (
39- "Constructor called in sync fashion, test-only\n" ,
40- new Error ( ) . stack
41- ) ;
42- return ;
38+ return ( ( async ( ) : Promise < Repository > => {
39+ return this ;
40+ } ) ( ) as unknown ) as Repository ;
4341 }
4442 return ( ( async ( ) : Promise < Repository > => {
4543 await this . updateInfo ( ) ;
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import { ISvnResourceGroup } from "../common/types";
1717import { Model } from "../model" ;
1818import { Repository } from "../repository" ;
1919import * as testUtil from "./testUtil" ;
20+ import { timeout } from "../util" ;
2021
2122// Defines a Mocha test suite to group tests of similar kind together
2223suite ( "Commands Tests" , ( ) => {
@@ -174,6 +175,9 @@ suite("Commands Tests", () => {
174175 testUtil . overrideNextShowInputBox ( "Created new branch test" ) ;
175176 await commands . executeCommand ( "svn.switchBranch" ) ;
176177
178+ // Wait run updateRemoteChangedFiles
179+ await timeout ( 2000 ) ;
180+
177181 const repository = model . getRepository ( checkoutDir ) as Repository ;
178182 assert . equal ( await repository . getCurrentBranch ( ) , "branches/test" ) ;
179183 } ) ;
@@ -182,6 +186,9 @@ suite("Commands Tests", () => {
182186 testUtil . overrideNextShowQuickPick ( 2 ) ;
183187 await commands . executeCommand ( "svn.switchBranch" ) ;
184188
189+ // Wait run updateRemoteChangedFiles
190+ await timeout ( 2000 ) ;
191+
185192 const repository = model . getRepository ( checkoutDir ) as Repository ;
186193 assert . equal ( await repository . getCurrentBranch ( ) , "trunk" ) ;
187194 } ) ;
You can’t perform that action at this time.
0 commit comments