[gnome-shell] tests: Work around import dependency loop
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] tests: Work around import dependency loop
- Date: Thu, 7 Feb 2019 01:47:45 +0000 (UTC)
commit c6d57059ffea325f5be11bca38ea83c5ac5f23e0
Author: Florian Müllner <fmuellner gnome org>
Date: Thu Feb 7 01:56:29 2019 +0100
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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]