From 3f3df098193778907c58ccce089ee3da82523991 Mon Sep 17 00:00:00 2001 From: TC Date: Mon, 5 Sep 2022 00:38:24 +0200 Subject: [PATCH] Set NODE_ENV programmatically --- package.json | 4 ++-- tests/index.test.js | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index c13c3a0b42..6496a32124 100644 --- a/package.json +++ b/package.json @@ -67,8 +67,8 @@ } }, "scripts": { - "test": "NODE_ENV=test playwright test", - "test:debug": "DEBUG=pw:browser* NODE_ENV=test playwright test", + "test": "playwright test", + "test:debug": "DEBUG=pw:browser* playwright test", "start": "electron .", "start:debug": "ELECTRON_ENABLE_LOGGING=1 electron .", "icon": "rimraf assets/generated && electron-icon-maker --input=assets/youtube-music.png --output=assets/generated", diff --git a/tests/index.test.js b/tests/index.test.js index 01c3857681..6a58aa24b8 100644 --- a/tests/index.test.js +++ b/tests/index.test.js @@ -3,6 +3,8 @@ const path = require("path"); const { _electron: electron } = require("playwright"); const { test, expect } = require("@playwright/test"); +process.env.NODE_ENV = "test"; + const appPath = path.resolve(__dirname, ".."); test("YouTube Music App - With default settings, app is launched and visible", async () => {