From 077ae6efa13669b013d941649f75fe53be254605 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Fri, 15 Nov 2024 11:08:09 -0500 Subject: [PATCH] headless-browser: Create the expectation directory if it doesn't exist This is convenient when adding tests to a new folder. --- UI/Headless/Test.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/UI/Headless/Test.cpp b/UI/Headless/Test.cpp index 84e78531499..ab6b6d43555 100644 --- a/UI/Headless/Test.cpp +++ b/UI/Headless/Test.cpp @@ -143,6 +143,8 @@ void run_dump_test(HeadlessWebView& view, Test& test, URL::URL const& url, int t } if (Application::the().rebaseline) { + TRY(Core::Directory::create(LexicalPath { test.expectation_path }.parent().string(), Core::Directory::CreateDirectories::Yes)); + auto expectation_file = TRY(open_expectation_file(Core::File::OpenMode::Write)); TRY(expectation_file->write_until_depleted(test.text));