From c6d57059ffea325f5be11bca38ea83c5ac5f23e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Thu, 7 Feb 2019 01:56:29 +0100 Subject: [PATCH] tests: Work around import dependency loop The markup unit test currently fails with the following message: TypeError: class heritage MessageList.Message is not an object or null This is because MessageList imports other modules that end up importing MessageList themselves in order to inherit from one of its classes. But as the MessageList imports hasn't finished yet (it's still processing its own imports), that class hasn't been defined yet. Work around that by importing Main first, so that the importer can process imports in a proper order. --- tests/unit/markup.js | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/unit/markup.js b/tests/unit/markup.js index c55791ea5..603ca8194 100644 --- a/tests/unit/markup.js +++ b/tests/unit/markup.js @@ -8,6 +8,7 @@ const Pango = imports.gi.Pango; const Environment = imports.ui.environment; Environment.init(); +const Main = imports.ui.main; // unused, but needed to break dependency loop const MessageList = imports.ui.messageList; // Assert that @input, assumed to be markup, gets "fixed" to @output,