From 8680ac3dfd51ab1276eb05d17ef8837e023f4a1f Mon Sep 17 00:00:00 2001 From: pythongosssss <125205205+pythongosssss@users.noreply.github.com> Date: Tue, 19 Dec 2023 20:38:07 +0000 Subject: [PATCH] try to improve test reliability --- .github/workflows/test-ui.yaml | 2 +- tests-ui/afterSetup.js | 9 +++++++++ tests-ui/jest.config.js | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 tests-ui/afterSetup.js diff --git a/.github/workflows/test-ui.yaml b/.github/workflows/test-ui.yaml index 95069175..4b8b9793 100644 --- a/.github/workflows/test-ui.yaml +++ b/.github/workflows/test-ui.yaml @@ -22,5 +22,5 @@ jobs: run: | npm ci npm run test:generate - npm test + npm test -- --verbose working-directory: ./tests-ui diff --git a/tests-ui/afterSetup.js b/tests-ui/afterSetup.js new file mode 100644 index 00000000..983f3af6 --- /dev/null +++ b/tests-ui/afterSetup.js @@ -0,0 +1,9 @@ +const { start } = require("./utils"); +const lg = require("./utils/litegraph"); + +// Load things once per test file before to ensure its all warmed up for the tests +beforeAll(async () => { + lg.setup(global); + await start({ resetEnv: true }); + lg.teardown(global); +}); diff --git a/tests-ui/jest.config.js b/tests-ui/jest.config.js index b5a5d646..86fff505 100644 --- a/tests-ui/jest.config.js +++ b/tests-ui/jest.config.js @@ -2,8 +2,10 @@ const config = { testEnvironment: "jsdom", setupFiles: ["./globalSetup.js"], + setupFilesAfterEnv: ["./afterSetup.js"], clearMocks: true, resetModules: true, + testTimeout: 10000 }; module.exports = config;