Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

consoleReporter: Fix warning with newer GIO versions #51

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Priority: optional
Maintainer: Philip Chimento <[email protected]>
Build-Depends: debhelper-compat (= 12),
gir1.2-glib-2.0,
gjs (>= 1.68.0),
gjs (>= 1.71.1),
meson (>= 0.58.0)
Standards-Version: 4.5.0
Homepage: https://github.com/ptomato/jasmine-gjs
Expand All @@ -13,7 +13,7 @@ Package: jasmine-gjs
Architecture: all
Depends: ${misc:Depends},
gir1.2-glib-2.0,
gjs (>= 1.68.0)
gjs (>= 1.71.1)
Description: Behavior-driven development framework for GJS
This module allows you to run Jasmine specs for your GJS code. The output will
be displayed in your terminal.
4 changes: 2 additions & 2 deletions jasmine-gjs.spec
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ URL: https://github.com/ptomato/jasmine-gjs
Source0: https://github.com/ptomato/jasmine-gjs/releases/download/3.10.1/jasmine-gjs-3.10.1.tar.xz

BuildArch: noarch
BuildRequires: gjs >= 1.68.0
BuildRequires: gjs >= 1.71.1
BuildRequires: gobject-introspection
BuildRequires: meson >= 0.58.0
Requires: gjs >= 1.68.0
Requires: gjs >= 1.71.1
Requires: gobject-introspection

%description
Expand Down
10 changes: 9 additions & 1 deletion src/consoleReporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ const GREEN = '\x1b[32m';
const RED = '\x1b[31m';
const NORMAL = '\x1b[0m';

let GioUnix = null;
try {
GioUnix = (await import('gi://GioUnix')).default;
} catch (e) {}

function createNoopTimer() {
return {
start() {},
Expand Down Expand Up @@ -76,8 +81,11 @@ export const ConsoleReporter = GObject.registerClass({
// everything)
static getStdout() {
if (!this._stdout) {
const UnixOutputStream = GioUnix
? GioUnix.OutputStream
: Gio.UnixOutputStream;
const FD_STDOUT = 1;
const fdstream = new Gio.UnixOutputStream({
const fdstream = new UnixOutputStream({
fd: FD_STDOUT,
close_fd: false,
});
Expand Down