gui tests: i18n-keys leaves vendored third_party code out
0caa09b3dvendored 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 at01c3efc4f(and on origin/maindf2b819c6) with 'plugins/usage/i18n.js "Error type": third_party/yaml.v3/yamlh.go says it too'.
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user