From be679ecc10836c95d322241b2bf00acef780950e Mon Sep 17 00:00:00 2001 From: Steven Hugg Date: Wed, 4 Aug 2021 21:20:55 -0500 Subject: [PATCH] fixed unit tests --- src/common/emu.ts | 4 ++-- src/ide/ui.ts | 2 +- test/cli/testgithub.js | 2 +- test/cli/teststore.js | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/common/emu.ts b/src/common/emu.ts index 2b6ef03d..e9adfcb2 100644 --- a/src/common/emu.ts +++ b/src/common/emu.ts @@ -233,7 +233,7 @@ export class EmuHalt extends Error { } } -export var useRequestAnimationFrame : boolean = typeof window.requestAnimationFrame === 'function'; // need for unit test +export var useRequestAnimationFrame : boolean = true; export class AnimationTimer { @@ -245,7 +245,7 @@ export class AnimationTimer { startts; // for FPS calc frameRate; intervalMsec; - useReqAnimFrame = useRequestAnimationFrame; + useReqAnimFrame = useRequestAnimationFrame && typeof window.requestAnimationFrame === 'function'; // need for unit test constructor(frequencyHz:number, callback:() => void) { this.frameRate = frequencyHz; diff --git a/src/ide/ui.ts b/src/ide/ui.ts index 17ecdf28..00641c4b 100644 --- a/src/ide/ui.ts +++ b/src/ide/ui.ts @@ -2246,7 +2246,7 @@ export function setupSplits() { if (platform_id.startsWith('vcs')) sizes = [0, 50, 50]; else if (isEmbed || isMobileDevice) - sizes = [0, 60, 40]; + sizes = [0, 55, 45]; else sizes = [12, 44, 44]; var sizesStr = hasLocalStorage && localStorage.getItem(splitName); diff --git a/test/cli/testgithub.js b/test/cli/testgithub.js index 7f8d3303..9be90e54 100644 --- a/test/cli/testgithub.js +++ b/test/cli/testgithub.js @@ -5,7 +5,7 @@ var fs = require('fs'); var assert = require('assert'); var wtu = require('./workertestutils.js'); // loads localStorage -global.localforage = require("lib/localforage.min.js"); +var localforage = require("localforage"); var util = require("gen/common/util.js"); var prj = require("gen/ide/project.js"); var serv = require("gen/ide/services.js"); diff --git a/test/cli/teststore.js b/test/cli/teststore.js index f83c627f..7ccb7ffa 100644 --- a/test/cli/teststore.js +++ b/test/cli/teststore.js @@ -5,7 +5,7 @@ var fs = require('fs'); var assert = require('assert'); var wtu = require('./workertestutils.js'); // loads localStorage -global.localforage = require("lib/localforage.min.js"); +var localforage = require("localforage"); var util = require("gen/common/util.js"); var prj = require("gen/ide/project.js");