<commit_before>/**
 * Backstop config.
 *
 * Site Kit by Google, Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

const scenarios = require( './scenarios' );
const viewports = require( './viewports' );

// If run from the host, detect the proper target host and set the hostname arg.
// This will be passed through with the `backstop` command run with docker.
if ( process.argv.includes( '--docker' ) ) {
	const hostname = require( './detect-storybook-host' );
	process.argv.push( `--storybook-host=http://${ hostname }:9001` );
}

module.exports = {
	onBeforeScript: 'puppet/onBefore.js',
	asyncCaptureLimit: 5,
	asyncCompareLimit: 50,
	debug: false,
	debugWindow: false,
	// Use a custom command template to make sure it works correctly in the GitHub actions environment.
	// The only difference between the original dockerCommandTemplate and this one is that there is no -t flag in the currect template.
	dockerCommandTemplate: 'docker run --rm -i --mount type=bind,source="{cwd}",target=/src backstopjs/backstopjs:{version} {backstopCommand} {args}',
	engine: 'puppeteer',
	engineOptions: {
		args: [ '--no-sandbox' ],
	},
	id: 'google-site-kit',
	paths: {
		bitmaps_reference: 'tests/backstop/reference',
		bitmaps_test: 'tests/backstop/tests',
		engine_scripts: 'tests/backstop/engine_scripts',
		html_report: 'tests/backstop/html_report',
		ci_report: 'tests/backstop/ci_report',
	},
	report: [ 'browser' ],
	scenarios,
	viewports,
	readyEvent: 'backstopjs_ready',
	misMatchThreshold: 0.05, // @todo change to 0, resolve SVG issue.
	delay: 1000, // Default delay to ensure components render complete.<commit_msg>Fix typo.<commit_after>/**
 * Backstop config.
 *
 * Site Kit by Google, Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

const scenarios = require( './scenarios' );
const viewports = require( './viewports' );

// If run from the host, detect the proper target host and set the hostname arg.
// This will be passed through with the `backstop` command run with docker.
if ( process.argv.includes( '--docker' ) ) {
	const hostname = require( './detect-storybook-host' );
	process.argv.push( `--storybook-host=${ hostname }` );
}

module.exports = {
	onBeforeScript: 'puppet/onBefore.js',
	asyncCaptureLimit: 5,
	asyncCompareLimit: 50,
	debug: false,
	debugWindow: false,
	// Use a custom command template to make sure it works correctly in the GitHub actions environment.
	// The only difference between the original dockerCommandTemplate and this one is that there is no -t flag in the currect template.
	dockerCommandTemplate: 'docker run --rm -i --mount type=bind,source="{cwd}",target=/src backstopjs/backstopjs:{version} {backstopCommand} {args}',
	engine: 'puppeteer',
	engineOptions: {
		args: [ '--no-sandbox' ],
	},
	id: 'google-site-kit',
	paths: {
		bitmaps_reference: 'tests/backstop/reference',
		bitmaps_test: 'tests/backstop/tests',
		engine_scripts: 'tests/backstop/engine_scripts',
		html_report: 'tests/backstop/html_report',
		ci_report: 'tests/backstop/ci_report',
	},
	report: [ 'browser' ],
	scenarios,
	viewports,
	readyEvent: 'backstopjs_ready',
	misMatchThreshold: 0.05, // @todo change to 0, resolve SVG issue.
	delay: 1000, // Default delay to ensure components render complete.
{'fraction_non_alphanumeric': 0.11407992565055762, 'fraction_numerical': 0.009758364312267658, 'mean_word_length': 4.193003618817853, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4706093', 'n_tokens_mistral': 1322, 'n_tokens_neox': 1259, 'n_words': 469}