gui tests: i18n-keys leaves vendored third_party code out

0caa09b3d vendored yaml.v3 under third_party/, and its yamlh.go says
"Error type", a key of the usage plugin's i18n.js, so "a plugin's words
are its own" went red on main. Vendored code says nothing to magpie's
window; the walk now skips third_party like node_modules.

Run (mote): node --test internal/gui/tests/i18n-keys.test.cjs: 4 of 4
pass; red before this change at 01c3efc4f (and on origin/main
df2b819c6) with 'plugins/usage/i18n.js "Error type":
third_party/yaml.v3/yamlh.go says it too'.
This commit is contained in:
yetone
2026-11-14 15:34:08 +08:00
parent 01c3efc4f7
commit ea6470cb75
+2 -1
View File
@@ -45,7 +45,8 @@ test("a plugin's words are its own", () => {
for (const e of fs.readdirSync(d, { withFileTypes: true })) {
const p = path.join(d, e.name);
if (e.isDirectory()) {
if (!["node_modules", ".git", "site", "tests", "testdata", "docs"].includes(e.name)) walk(p);
// third_party is vendored code, which says nothing to the window
if (!["node_modules", ".git", "site", "tests", "testdata", "docs", "third_party"].includes(e.name)) walk(p);
} else if (/\.(go|js|html|css)$/.test(e.name) && e.name !== "i18n.js") {
let text = fs.readFileSync(p, "utf8");
// a comment line says nothing to the window: Go's "(View routing,