Yoast / wordpress-seo

Yoast SEO for WordPress
https://yoast.com/wordpress/plugins/seo/
Other
1.76k stars 885 forks source link

Duplicate mocks in JS tests #12643

Open igorschoester opened 5 years ago

igorschoester commented 5 years ago

Please give us a description of what happened.

When running Jest tests I get duplicate manual mock warnings for:

Full output ``` jest-haste-map: duplicate manual mock found: Module name: fileMock Duplicate Mock path: /Users/igorschoester/vagrant-local/www/wordpress-default/public_html/wp-content/plugins/wordpress-seo/javascript/packages/yoast-components/jest/__mocks__/fileMock.js This warning is caused by two manual mock files with the same file name. Jest will use the mock file found in: /Users/igorschoester/vagrant-local/www/wordpress-default/public_html/wp-content/plugins/wordpress-seo/javascript/packages/yoast-components/jest/__mocks__/fileMock.js Please delete one of the following two files: /Users/igorschoester/vagrant-local/www/wordpress-default/public_html/wp-content/plugins/wordpress-seo/js/tests/__mocks__/fileMock.js /Users/igorschoester/vagrant-local/www/wordpress-default/public_html/wp-content/plugins/wordpress-seo/javascript/packages/yoast-components/jest/__mocks__/fileMock.js jest-haste-map: duplicate manual mock found: Module name: @wordpress/i18n Duplicate Mock path: /Users/igorschoester/vagrant-local/www/wordpress-default/public_html/wp-content/plugins/wordpress-seo/javascript/packages/yoast-components/jest/__mocks__/@wordpress/i18n.js This warning is caused by two manual mock files with the same file name. Jest will use the mock file found in: /Users/igorschoester/vagrant-local/www/wordpress-default/public_html/wp-content/plugins/wordpress-seo/javascript/packages/yoast-components/jest/__mocks__/@wordpress/i18n.js Please delete one of the following two files: /Users/igorschoester/vagrant-local/www/wordpress-default/public_html/wp-content/plugins/wordpress-seo/javascript/packages/search-metadata-previews/tests/__mocks__/@wordpress/i18n.js /Users/igorschoester/vagrant-local/www/wordpress-default/public_html/wp-content/plugins/wordpress-seo/javascript/packages/yoast-components/jest/__mocks__/@wordpress/i18n.js ```

Please describe what you expected to happen and why.

Not to get warnings.

How can we reproduce this behavior?

  1. Run yarn test
  2. See the console.

Technical info

Used versions

omarreiss commented 4 years ago

@igorschoester is this still relevant?