Skip to content

chore(tests): print more errors when snapshot tests fail - #5839

Merged
pajlada merged 1 commit into
masterfrom
chore/more-errors-in-snapshot-tests
Jan 19, 2025
Merged

pajlada merged 1 commit into
masterfrom
chore/more-errors-in-snapshot-tests

Conversation

@pajlada

@pajlada pajlada commented Jan 19, 2025

Copy link
Copy Markdown
Member

No description provided.

@pajlada pajlada left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

@pajlada pajlada added the ci Issues related to the ci label Jan 19, 2025
@pajlada
pajlada enabled auto-merge (squash) January 19, 2025 15:49
ASSERT_TRUE(snapshot->run(got, UPDATE_SNAPSHOTS));
ASSERT_TRUE(snapshot->run(got, UPDATE_SNAPSHOTS))
<< "Snapshot " << snapshot->name() << " failed. Expected JSON to be\n"
<< QJsonDocument::fromVariant(snapshot->output().toVariant()).toJson()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fromVariant can only create objects or arrays.
This should be something like

QString debugRepr(const auto& it) {
    QString str;
    QDebug dbg(&str);
    dbg << it;
    return str;
}

Qt 6.9 will allow QJsonValue.toJson().

@pajlada
pajlada merged commit 58748d0 into master Jan 19, 2025
@pajlada
pajlada deleted the chore/more-errors-in-snapshot-tests branch January 19, 2025 16:15
babicekmarek pushed a commit to babicekmarek/streamally-chatterino that referenced this pull request Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Issues related to the ci

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants