diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-18 11:17:02 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-18 11:17:02 +0300 |
commit | b39512ed755239198a9c294b6a45e65c05900235 (patch) | |
tree | d234a3efade1de67c46b9e5a38ce813627726aa7 /scripts/lib | |
parent | d31474cf3b17ece37939d20082b07f6657cc79a9 (diff) |
Add latest changes from gitlab-org/gitlab@15-3-stable-eev15.3.0-rc42
Diffstat (limited to 'scripts/lib')
-rw-r--r-- | scripts/lib/glfm/render_wysiwyg_html_and_json.js | 3 | ||||
-rw-r--r-- | scripts/lib/glfm/update_example_snapshots.rb | 10 |
2 files changed, 11 insertions, 2 deletions
diff --git a/scripts/lib/glfm/render_wysiwyg_html_and_json.js b/scripts/lib/glfm/render_wysiwyg_html_and_json.js index ed8bfdb4638..8f94f50d62b 100644 --- a/scripts/lib/glfm/render_wysiwyg_html_and_json.js +++ b/scripts/lib/glfm/render_wysiwyg_html_and_json.js @@ -1,6 +1,5 @@ import fs from 'fs'; import jsYaml from 'js-yaml'; -import { setTestTimeout } from 'jest/__helpers__/timeout'; import { renderHtmlAndJsonForAllExamples } from 'jest/content_editor/render_html_and_json_for_all_examples'; /* eslint-disable no-undef */ @@ -24,7 +23,7 @@ jest.mock('~/emoji'); // This script should be invoked via jest with the a command similar to the following: // yarn jest --testMatch '**/render_wysiwyg_html_and_json.js' ./scripts/lib/glfm/render_wysiwyg_html_and_json.js it('serializes html to prosemirror json', async () => { - setTestTimeout(20000); + jest.setTimeout(20000); const inputMarkdownTempfilePath = process.env.INPUT_MARKDOWN_YML_PATH; expect(inputMarkdownTempfilePath).not.toBeUndefined(); diff --git a/scripts/lib/glfm/update_example_snapshots.rb b/scripts/lib/glfm/update_example_snapshots.rb index 893d8d9c014..d8d6cf3cdbc 100644 --- a/scripts/lib/glfm/update_example_snapshots.rb +++ b/scripts/lib/glfm/update_example_snapshots.rb @@ -29,6 +29,8 @@ module Glfm def process(skip_static_and_wysiwyg: false) output('Updating example snapshots...') + setup_environment + output('(Skipping static HTML generation)') if skip_static_and_wysiwyg output("Reading #{GLFM_SPEC_TXT_PATH}...") @@ -47,6 +49,14 @@ module Glfm private + def setup_environment + # Set 'GITLAB_TEST_FOOTNOTE_ID' in order to override random number generation in + # Banzai::Filter::FootnoteFilter#random_number, and thus avoid the need to + # perform normalization on the value. See: + # https://docs.gitlab.com/ee/development/gitlab_flavored_markdown/specification_guide/#normalization + ENV['GITLAB_TEST_FOOTNOTE_ID'] = '42' + end + def add_example_names(all_examples) # NOTE: This method and the parse_examples method assume: # 1. Section 2 is the first section which contains examples |