Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

desktop: fix tests on windows

Abdullah Atta00b62df2e811
diff --git a/apps/desktop/__tests__/utils.ts b/apps/desktop/__tests__/utils.ts
index c2a3acaa4..62d254092 100644
--- a/apps/desktop/__tests__/utils.ts
+++ b/apps/desktop/__tests__/utils.ts
@@ -19,12 +19,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { execSync } from "child_process";
import { mkdir } from "fs/promises";
+import { fileURLToPath } from "node:url";
import path from "path";
import { _electron as electron } from "playwright";
import slugify from "slugify";
import { TaskContext } from "vitest";
-const __dirname = path.dirname(new URL(import.meta.url).pathname);
+const __filename = fileURLToPath(import.meta.url);
+const __dirname = path.dirname(__filename);
const IS_DEBUG = process.env.NN_DEBUG === "true" || process.env.CI === "true";
interface AppContext {
diff --git a/apps/desktop/src/main.ts b/apps/desktop/src/main.ts
index 860b8b137..9b3ea2f82 100644
--- a/apps/desktop/src/main.ts
+++ b/apps/desktop/src/main.ts
@@ -85,6 +85,8 @@ async function createWindow() {
const mainWindowState = new WindowState({});
const mainWindow = new BrowserWindow({
show: !cliOptions.hidden,
+ paintWhenInitiallyHidden: cliOptions.hidden,
+ skipTaskbar: cliOptions.hidden,
x: mainWindowState.x,
y: mainWindowState.y,
width: mainWindowState.width,
@@ -101,7 +103,10 @@ async function createWindow() {
...(config.desktopSettings.nativeTitlebar
? {}
: {
- titleBarStyle: process.platform === "win32" || process.platform === "darwin" ? "hidden" : "default",
+ titleBarStyle:
+ process.platform === "win32" || process.platform === "darwin"
+ ? "hidden"
+ : "default",
frame: process.platform === "win32" || process.platform === "darwin",
titleBarOverlay: {
height: 37,
diff --git a/apps/desktop/vitest.config.ts b/apps/desktop/vitest.config.ts
index 6dc1a438a..eacce4391 100644
--- a/apps/desktop/vitest.config.ts
+++ b/apps/desktop/vitest.config.ts
@@ -21,7 +21,7 @@ import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
- testTimeout: process.env.CI ? 120 * 1000 : 30 * 1000,
+ testTimeout: process.env.CI ? 120 * 1000 : 120 * 1000,
sequence: {
concurrent: true,
shuffle: true