From 0929b2a30713fb251414e9837acf88510f69300a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Tue, 11 Jul 2023 14:57:41 +0200 Subject: [PATCH] tests/shell: Import introspected libraries as modules Since commit 5e93791708 tests scripts are loaded as modules, so we can (and should) use "proper" imports. Part-of: --- tests/shell/basic.js | 2 +- tests/shell/closeWithActiveWindows.js | 2 +- tests/shell/headlessStart.js | 6 +++--- tests/shell/hwtest.js | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/shell/basic.js b/tests/shell/basic.js index ef75ca423..588123fd8 100644 --- a/tests/shell/basic.js +++ b/tests/shell/basic.js @@ -1,7 +1,7 @@ // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- /* eslint camelcase: ["error", { properties: "never", allow: ["^script_"] }] */ -const St = imports.gi.St; +import St from 'gi://St'; const Main = imports.ui.main; const MessageTray = imports.ui.messageTray; diff --git a/tests/shell/closeWithActiveWindows.js b/tests/shell/closeWithActiveWindows.js index 2d696792c..a2bec7954 100644 --- a/tests/shell/closeWithActiveWindows.js +++ b/tests/shell/closeWithActiveWindows.js @@ -1,7 +1,7 @@ // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- /* eslint camelcase: ["error", { properties: "never", allow: ["^script_", "^malloc", "^glx", "^clutter"] }] */ -const Clutter = imports.gi.Clutter; +import Clutter from 'gi://Clutter'; const Main = imports.ui.main; const Scripting = imports.ui.scripting; diff --git a/tests/shell/headlessStart.js b/tests/shell/headlessStart.js index 6f4157b2b..120d259d0 100644 --- a/tests/shell/headlessStart.js +++ b/tests/shell/headlessStart.js @@ -1,9 +1,9 @@ // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- /* eslint camelcase: ["error", { properties: "never", allow: ["^script_"] }] */ -const GLib = imports.gi.GLib; -const MetaTest = imports.gi.MetaTest; -const Shell = imports.gi.Shell; +import GLib from 'gi://GLib'; +import MetaTest from 'gi://MetaTest'; +import Shell from 'gi://Shell'; const Main = imports.ui.main; const Scripting = imports.ui.scripting; diff --git a/tests/shell/hwtest.js b/tests/shell/hwtest.js index 6e4cd7ea2..5d9bfdb54 100644 --- a/tests/shell/hwtest.js +++ b/tests/shell/hwtest.js @@ -1,7 +1,7 @@ /* eslint camelcase: ["error", { properties: "never", allow: ["^script_", "^clutter"] }] */ -const Clutter = imports.gi.Clutter; -const Gio = imports.gi.Gio; -const Shell = imports.gi.Shell; +import Clutter from 'gi://Clutter'; +import Gio from 'gi://Gio'; +import Shell from 'gi://Shell'; const Main = imports.ui.main; const Scripting = imports.ui.scripting;