···140140 const prependedPlays = [newPlay, ...plays];
141141 expect(source.parseRecentAgainstResponse(prependedPlays).plays).length(1);
142142143143- await sleep(1000);
143143+ await sleep(50);
144144145145 // YT returns outdated history
146146 // should be detected as append since "removed" track in last position from previous history is seen again
···148148 expect(badAppend).to.deep.include({consistent: false, diffType: 'added', plays: []});
149149 expect(badAppend.diffResults[2]).eq('append');
150150151151- await sleep(500);
151151+ await sleep(10);
152152153153 // contiuned outdated history
154154 expect(source.parseRecentAgainstResponse(plays)).to.deep.include({consistent: true, plays: []});
155155156156- await sleep(500);
156156+ await sleep(10);
157157158158 // correct, current history is finally returned correctly
159159 const recentHistoryResult = source.parseRecentAgainstResponse(prependedPlays);
+1-1
src/core/StringUtils.ts
···230230/**
231231 * Returns value if it is a non-empty string or returns default value
232232 * */
233233-export const nonEmptyStringOrDefault = <T>(str: any, defaultVal: T = undefined): string | T => {
233233+export const nonEmptyStringOrDefault = <T = undefined>(str: any, defaultVal: T = undefined): string | T => {
234234 if (str === undefined || str === null || typeof str !== 'string' || str.trim() === '') {
235235 return defaultVal;
236236 }