From a7e13f9719223f04ed1bceb7c7c91d5a04a7d761 Mon Sep 17 00:00:00 2001 From: Stanislav Levin Date: Feb 17 2023 08:44:53 +0000 Subject: tests: webui: Load qunit only once webui unit tests fail with grunt-contrib-qunit: ``` Testing test/all_tests.html >> Error: Error: QUnit has already been defined. >> at exportQUnit (file:///home/test/freeipa/install/ui/js/qunit.js:2475:12) >> at file:///home/test/freeipa/install/ui/js/qunit.js:2946:3 >> at file:///home/test/freeipa/install/ui/js/qunit.js:5061:2 >> Error: TypeError: Cannot set properties of undefined (setting 'reorder') >> at :175:24 >> at runFactory (file:///home/test/freeipa/install/ui/js/dojo/dojo.js:1:17157) >> at execModule (file:///home/test/freeipa/install/ui/js/dojo/dojo.js:1:19541) >> at file:///home/test/freeipa/install/ui/js/dojo/dojo.js:1:20002 >> at guardCheckComplete (file:///home/test/freeipa/install/ui/js/dojo/dojo.js:1:19707) >> at checkComplete (file:///home/test/freeipa/install/ui/js/dojo/dojo.js:1:19854) >> at onLoadCallback (file:///home/test/freeipa/install/ui/js/dojo/dojo.js:1:22296) >> at HTMLScriptElement.onLoad (file:///home/test/freeipa/install/ui/js/dojo/dojo.js:1:26209) ``` Load `qunit` with `dojo.require` that among other useful things helps > Preventing loading Dojo packages twice. dojo.require will simply return if the package is already loaded. See also https://github.com/gruntjs/grunt-contrib-qunit#loading-qunit-with-amd Related: https://pagure.io/freeipa/issue/9329 Signed-off-by: Stanislav Levin Reviewed-By: Florence Blanc-Renaud --- diff --git a/install/ui/test/all_tests.html b/install/ui/test/all_tests.html index c4104fe..eb548dc 100644 --- a/install/ui/test/all_tests.html +++ b/install/ui/test/all_tests.html @@ -6,23 +6,14 @@ - - +