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.
This commit is contained in:
Florian Müllner 2019-02-07 01:56:29 +01:00
parent 5f13cf767e
commit c6d57059ff

View File

@ -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,