From 9d4eabe931c29e57c018a425df42767ee67b4e2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20G=C3=BCnter?= Date: Thu, 13 Jun 2024 11:03:28 +0200 Subject: [PATCH 1/2] test: add test cases for rspack --- features/makepot.feature | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/features/makepot.feature b/features/makepot.feature index 4df6200..6635b75 100644 --- a/features/makepot.feature +++ b/features/makepot.feature @@ -1838,6 +1838,10 @@ Feature: Generate a POT file of a WordPress project Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__["__"])( 'webpack.__', 'foo-plugin' ); Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__[/* __ */ "a"])( 'webpack.mangle.__', 'foo-plugin' ); + (0,wp__WEBPACK_IMPORTED_MODULE_5__.__)("rspack.__", "foo-plugin"); + wp__WEBPACK_IMPORTED_MODULE_5___default().__("rspack.default-import.__", "foo-plugin"); + wp__WEBPACK_IMPORTED_MODULE_5__.__("rspack.default-star-import.__", "foo-plugin"); + Object(u.__)( 'minified.__', 'foo-plugin' ); Object(j._x)( 'minified._x', 'minified._x_context', 'foo-plugin' ); @@ -1918,6 +1922,18 @@ Feature: Generate a POT file of a WordPress project """ msgid "webpack.mangle.__" """ + And the foo-plugin/foo-plugin.pot file should contain: + """ + msgid "rspack.__" + """ + And the foo-plugin/foo-plugin.pot file should contain: + """ + msgid "rspack.default-import.__" + """ + And the foo-plugin/foo-plugin.pot file should contain: + """ + msgid "rspack.default-star-import.__" + """ And the foo-plugin/foo-plugin.pot file should contain: """ msgid "minified.__" From bdbb1545cde062b6007a054b3e68f540764a763b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20G=C3=BCnter?= Date: Thu, 13 Jun 2024 11:10:19 +0200 Subject: [PATCH 2/2] test: add test cases for esbuild --- features/makepot.feature | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/features/makepot.feature b/features/makepot.feature index 6635b75..802f2f9 100644 --- a/features/makepot.feature +++ b/features/makepot.feature @@ -1842,6 +1842,13 @@ Feature: Generate a POT file of a WordPress project wp__WEBPACK_IMPORTED_MODULE_5___default().__("rspack.default-import.__", "foo-plugin"); wp__WEBPACK_IMPORTED_MODULE_5__.__("rspack.default-star-import.__", "foo-plugin"); + var import_wp = __require("wp"); + var import_wp2 = __toESM(__require("wp")); + var wpStarImport = __toESM(__require("wp")); + console.log((0, import_wp.__)("esbuild.__", "foo-plugin")); + console.log(import_wp2.default.__("esbuild.default-import.__", "foo-plugin")); + console.log(wpStarImport.__("esbuild.default-star-import.__", "foo-plugin")); + Object(u.__)( 'minified.__', 'foo-plugin' ); Object(j._x)( 'minified._x', 'minified._x_context', 'foo-plugin' ); @@ -1934,6 +1941,18 @@ Feature: Generate a POT file of a WordPress project """ msgid "rspack.default-star-import.__" """ + And the foo-plugin/foo-plugin.pot file should contain: + """ + msgid "esbuild.__" + """ + And the foo-plugin/foo-plugin.pot file should contain: + """ + msgid "esbuild.default-import.__" + """ + And the foo-plugin/foo-plugin.pot file should contain: + """ + msgid "esbuild.default-star-import.__" + """ And the foo-plugin/foo-plugin.pot file should contain: """ msgid "minified.__"