User:MM abc.xyz/common.js

From Wikimedia Foundation Governance Wiki
Revision as of 01:50, 8 February 2024 by MM abc.xyz (talk | contribs) (Replaced content with "'use strict'; // For a detailed explanation regarding each configuration property, visit: // https://jestjs.io/docs/en/configuration.html module.exports = { moduleNameMapper: { '@wikimedia/codex-search': '@wikimedia/codex', '^./templates/(.*).mustache': '<rootDir>/includes/templates/$1.mustache' }, // Automatically clear mock calls and instances between every test clearMocks: true, // Indicates whether the coverage information should be collected while e...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
'use strict';

// For a detailed explanation regarding each configuration property, visit:
// https://jestjs.io/docs/en/configuration.html

module.exports = {
	moduleNameMapper: {
		'@wikimedia/codex-search': '@wikimedia/codex',
		'^./templates/(.*).mustache': '<rootDir>/includes/templates/$1.mustache'
	},

	// Automatically clear mock calls and instances between every test
	clearMocks: true,

	// Indicates whether the coverage information should be collected while executing the test
	collectCoverage: true,

	// An array of glob patterns indicating a set of files fo
	//  which coverage information should be collected
	collectCoverageFrom: [
		'resources/**/*.(js|vue)'
	],

	// The directory where Jest should output its coverage files
	coverageDirectory: 'coverage',

	// An array of regexp pattern strings used to skip coverage collection
	coveragePathIgnorePatterns: [
		'/node_modules/',
		'/resources/skins.vector.typographySurvey/'
	],

	// An object that configures minimum threshold enforcement for coverage results
	coverageThreshold: {
		global: {
			branches: 31,
			functions: 39,
			lines: 38,
			statements: 38
		}
	},

	// An array of file extensions your modules use
	moduleFileExtensions: [
		'js',
		'json',
		'vue'
	],

	// The paths to modules that run some code to configure or
	// set up the testing environment before each test
	setupFiles: [
		'./jest.setup.js'
	],

	testEnvironment: 'jsdom',

	transform: {
		'^.+\\.mustache?$': 'mustache-jest',
		'.*\\.(vue)$': '<rootDir>/node_modules/@vue/vue3-jest'
	}
};