From 9d21c3c97359f44c2de154bf613f1887953cfe44 Mon Sep 17 00:00:00 2001 From: lowlighter <22963968+lowlighter@users.noreply.github.com> Date: Thu, 13 Jan 2022 23:47:13 -0500 Subject: [PATCH] tests: move `tests/plugins/*/tests.yml` to `tests/plugins/*/yml` --- .github/examples.mjs | 6 ++---- tests/metrics.test.js | 2 +- tests/plugins/{achievements/tests.yml => achievements.yml} | 0 tests/plugins/{activity/tests.yml => activity.yml} | 0 tests/plugins/{anilist/tests.yml => anilist.yml} | 0 tests/plugins/{base/tests.yml => base.yml} | 0 tests/plugins/{code/tests.yml => code.yml} | 0 tests/plugins/{contributors/tests.yml => contributors.yml} | 0 tests/plugins/{core/tests.yml => core.yml} | 0 tests/plugins/{discussions/tests.yml => discussions.yml} | 0 tests/plugins/{followup/tests.yml => followup.yml} | 0 tests/plugins/{gists/tests.yml => gists.yml} | 0 tests/plugins/{habits/tests.yml => habits.yml} | 0 tests/plugins/{introduction/tests.yml => introduction.yml} | 0 tests/plugins/{isocalendar/tests.yml => isocalendar.yml} | 0 tests/plugins/{languages/tests.yml => languages.yml} | 0 tests/plugins/{licenses/tests.yml => licenses.yml} | 0 tests/plugins/{lines/tests.yml => lines.yml} | 0 tests/plugins/{music/tests.yml => music.yml} | 0 tests/plugins/{nightscout/tests.yml => nightscout.yml} | 0 tests/plugins/{notable/tests.yml => notable.yml} | 0 tests/plugins/{pagespeed/tests.yml => pagespeed.yml} | 0 tests/plugins/{people/tests.yml => people.yml} | 0 tests/plugins/{poopmap/tests.yml => poopmap.yml} | 0 tests/plugins/{posts/tests.yml => posts.yml} | 0 tests/plugins/{projects/tests.yml => projects.yml} | 0 tests/plugins/{reactions/tests.yml => reactions.yml} | 0 tests/plugins/{repositories/tests.yml => repositories.yml} | 0 tests/plugins/{rss/tests.yml => rss.yml} | 0 tests/plugins/{screenshot/tests.yml => screenshot.yml} | 0 tests/plugins/{skyline/tests.yml => skyline.yml} | 0 tests/plugins/{sponsors/tests.yml => sponsors.yml} | 0 .../plugins/{stackoverflow/tests.yml => stackoverflow.yml} | 0 tests/plugins/{stargazers/tests.yml => stargazers.yml} | 0 tests/plugins/{starlists/tests.yml => starlists.yml} | 0 tests/plugins/{stars/tests.yml => stars.yml} | 0 tests/plugins/{stock/tests.yml => stock.yml} | 0 tests/plugins/{support/tests.yml => support.yml} | 0 tests/plugins/{topics/tests.yml => topics.yml} | 0 tests/plugins/{traffic/tests.yml => traffic.yml} | 0 tests/plugins/{tweets/tests.yml => tweets.yml} | 0 tests/plugins/{wakatime/tests.yml => wakatime.yml} | 0 42 files changed, 3 insertions(+), 5 deletions(-) rename tests/plugins/{achievements/tests.yml => achievements.yml} (100%) rename tests/plugins/{activity/tests.yml => activity.yml} (100%) rename tests/plugins/{anilist/tests.yml => anilist.yml} (100%) rename tests/plugins/{base/tests.yml => base.yml} (100%) rename tests/plugins/{code/tests.yml => code.yml} (100%) rename tests/plugins/{contributors/tests.yml => contributors.yml} (100%) rename tests/plugins/{core/tests.yml => core.yml} (100%) rename tests/plugins/{discussions/tests.yml => discussions.yml} (100%) rename tests/plugins/{followup/tests.yml => followup.yml} (100%) rename tests/plugins/{gists/tests.yml => gists.yml} (100%) rename tests/plugins/{habits/tests.yml => habits.yml} (100%) rename tests/plugins/{introduction/tests.yml => introduction.yml} (100%) rename tests/plugins/{isocalendar/tests.yml => isocalendar.yml} (100%) rename tests/plugins/{languages/tests.yml => languages.yml} (100%) rename tests/plugins/{licenses/tests.yml => licenses.yml} (100%) rename tests/plugins/{lines/tests.yml => lines.yml} (100%) rename tests/plugins/{music/tests.yml => music.yml} (100%) rename tests/plugins/{nightscout/tests.yml => nightscout.yml} (100%) rename tests/plugins/{notable/tests.yml => notable.yml} (100%) rename tests/plugins/{pagespeed/tests.yml => pagespeed.yml} (100%) rename tests/plugins/{people/tests.yml => people.yml} (100%) rename tests/plugins/{poopmap/tests.yml => poopmap.yml} (100%) rename tests/plugins/{posts/tests.yml => posts.yml} (100%) rename tests/plugins/{projects/tests.yml => projects.yml} (100%) rename tests/plugins/{reactions/tests.yml => reactions.yml} (100%) rename tests/plugins/{repositories/tests.yml => repositories.yml} (100%) rename tests/plugins/{rss/tests.yml => rss.yml} (100%) rename tests/plugins/{screenshot/tests.yml => screenshot.yml} (100%) rename tests/plugins/{skyline/tests.yml => skyline.yml} (100%) rename tests/plugins/{sponsors/tests.yml => sponsors.yml} (100%) rename tests/plugins/{stackoverflow/tests.yml => stackoverflow.yml} (100%) rename tests/plugins/{stargazers/tests.yml => stargazers.yml} (100%) rename tests/plugins/{starlists/tests.yml => starlists.yml} (100%) rename tests/plugins/{stars/tests.yml => stars.yml} (100%) rename tests/plugins/{stock/tests.yml => stock.yml} (100%) rename tests/plugins/{support/tests.yml => support.yml} (100%) rename tests/plugins/{topics/tests.yml => topics.yml} (100%) rename tests/plugins/{traffic/tests.yml => traffic.yml} (100%) rename tests/plugins/{tweets/tests.yml => tweets.yml} (100%) rename tests/plugins/{wakatime/tests.yml => wakatime.yml} (100%) diff --git a/.github/examples.mjs b/.github/examples.mjs index cb10e2c0..f9bce72c 100644 --- a/.github/examples.mjs +++ b/.github/examples.mjs @@ -26,8 +26,7 @@ async function plugin(id) { content:`${await fs.readFile(readme)}` }, tests:{ - dir:tests, - file:paths.join(tests, "tests.yml") + path:paths.join(__test_plugins, `${id}.yml`) }, examples:fss.existsSync(examples) ? yaml.load(await fs.readFile(examples), "utf8") ?? [] : [], options:plugins[id].readme.table @@ -59,8 +58,7 @@ for (const id of Object.keys(plugins)) { .replace(/()[\s\S]*()/g, `$1\n${options}\n$2`) ) //Plugin tests - await fs.mkdir(tests.dir, { recursive: true }); - await fs.writeFile(tests.file, yaml.dump(examples.map(({prod, test = {}, name = "", ...step}) => { + await fs.writeFile(tests.path, yaml.dump(examples.map(({prod, test = {}, name = "", ...step}) => { const result = {name:`${plugins[id].name} - ${name}`, ...step, ...test} test.with ??= {} for (const [k, v] of Object.entries(result.with)) { diff --git a/tests/metrics.test.js b/tests/metrics.test.js index 352de418..6c3346d5 100644 --- a/tests/metrics.test.js +++ b/tests/metrics.test.js @@ -96,7 +96,7 @@ const metadata = JSON.parse(`${ const tests = [] for (const name in metadata.plugins) { const cases = yaml - .load(fs.readFileSync(path.join(__dirname, "../tests/plugins", name, "tests.yml"), "utf8")) + .load(fs.readFileSync(path.join(__dirname, "../tests/plugins", `${name}.yml`), "utf8")) ?.map(({ name: test, with: inputs, modes = [], timeout }) => { const skip = new Set(Object.entries(metadata.templates).filter(([_, { readme: { compatibility } }]) => !compatibility[name]).map(([template]) => template)) if (!(metadata.plugins[name].supports.includes("repository"))) diff --git a/tests/plugins/achievements/tests.yml b/tests/plugins/achievements.yml similarity index 100% rename from tests/plugins/achievements/tests.yml rename to tests/plugins/achievements.yml diff --git a/tests/plugins/activity/tests.yml b/tests/plugins/activity.yml similarity index 100% rename from tests/plugins/activity/tests.yml rename to tests/plugins/activity.yml diff --git a/tests/plugins/anilist/tests.yml b/tests/plugins/anilist.yml similarity index 100% rename from tests/plugins/anilist/tests.yml rename to tests/plugins/anilist.yml diff --git a/tests/plugins/base/tests.yml b/tests/plugins/base.yml similarity index 100% rename from tests/plugins/base/tests.yml rename to tests/plugins/base.yml diff --git a/tests/plugins/code/tests.yml b/tests/plugins/code.yml similarity index 100% rename from tests/plugins/code/tests.yml rename to tests/plugins/code.yml diff --git a/tests/plugins/contributors/tests.yml b/tests/plugins/contributors.yml similarity index 100% rename from tests/plugins/contributors/tests.yml rename to tests/plugins/contributors.yml diff --git a/tests/plugins/core/tests.yml b/tests/plugins/core.yml similarity index 100% rename from tests/plugins/core/tests.yml rename to tests/plugins/core.yml diff --git a/tests/plugins/discussions/tests.yml b/tests/plugins/discussions.yml similarity index 100% rename from tests/plugins/discussions/tests.yml rename to tests/plugins/discussions.yml diff --git a/tests/plugins/followup/tests.yml b/tests/plugins/followup.yml similarity index 100% rename from tests/plugins/followup/tests.yml rename to tests/plugins/followup.yml diff --git a/tests/plugins/gists/tests.yml b/tests/plugins/gists.yml similarity index 100% rename from tests/plugins/gists/tests.yml rename to tests/plugins/gists.yml diff --git a/tests/plugins/habits/tests.yml b/tests/plugins/habits.yml similarity index 100% rename from tests/plugins/habits/tests.yml rename to tests/plugins/habits.yml diff --git a/tests/plugins/introduction/tests.yml b/tests/plugins/introduction.yml similarity index 100% rename from tests/plugins/introduction/tests.yml rename to tests/plugins/introduction.yml diff --git a/tests/plugins/isocalendar/tests.yml b/tests/plugins/isocalendar.yml similarity index 100% rename from tests/plugins/isocalendar/tests.yml rename to tests/plugins/isocalendar.yml diff --git a/tests/plugins/languages/tests.yml b/tests/plugins/languages.yml similarity index 100% rename from tests/plugins/languages/tests.yml rename to tests/plugins/languages.yml diff --git a/tests/plugins/licenses/tests.yml b/tests/plugins/licenses.yml similarity index 100% rename from tests/plugins/licenses/tests.yml rename to tests/plugins/licenses.yml diff --git a/tests/plugins/lines/tests.yml b/tests/plugins/lines.yml similarity index 100% rename from tests/plugins/lines/tests.yml rename to tests/plugins/lines.yml diff --git a/tests/plugins/music/tests.yml b/tests/plugins/music.yml similarity index 100% rename from tests/plugins/music/tests.yml rename to tests/plugins/music.yml diff --git a/tests/plugins/nightscout/tests.yml b/tests/plugins/nightscout.yml similarity index 100% rename from tests/plugins/nightscout/tests.yml rename to tests/plugins/nightscout.yml diff --git a/tests/plugins/notable/tests.yml b/tests/plugins/notable.yml similarity index 100% rename from tests/plugins/notable/tests.yml rename to tests/plugins/notable.yml diff --git a/tests/plugins/pagespeed/tests.yml b/tests/plugins/pagespeed.yml similarity index 100% rename from tests/plugins/pagespeed/tests.yml rename to tests/plugins/pagespeed.yml diff --git a/tests/plugins/people/tests.yml b/tests/plugins/people.yml similarity index 100% rename from tests/plugins/people/tests.yml rename to tests/plugins/people.yml diff --git a/tests/plugins/poopmap/tests.yml b/tests/plugins/poopmap.yml similarity index 100% rename from tests/plugins/poopmap/tests.yml rename to tests/plugins/poopmap.yml diff --git a/tests/plugins/posts/tests.yml b/tests/plugins/posts.yml similarity index 100% rename from tests/plugins/posts/tests.yml rename to tests/plugins/posts.yml diff --git a/tests/plugins/projects/tests.yml b/tests/plugins/projects.yml similarity index 100% rename from tests/plugins/projects/tests.yml rename to tests/plugins/projects.yml diff --git a/tests/plugins/reactions/tests.yml b/tests/plugins/reactions.yml similarity index 100% rename from tests/plugins/reactions/tests.yml rename to tests/plugins/reactions.yml diff --git a/tests/plugins/repositories/tests.yml b/tests/plugins/repositories.yml similarity index 100% rename from tests/plugins/repositories/tests.yml rename to tests/plugins/repositories.yml diff --git a/tests/plugins/rss/tests.yml b/tests/plugins/rss.yml similarity index 100% rename from tests/plugins/rss/tests.yml rename to tests/plugins/rss.yml diff --git a/tests/plugins/screenshot/tests.yml b/tests/plugins/screenshot.yml similarity index 100% rename from tests/plugins/screenshot/tests.yml rename to tests/plugins/screenshot.yml diff --git a/tests/plugins/skyline/tests.yml b/tests/plugins/skyline.yml similarity index 100% rename from tests/plugins/skyline/tests.yml rename to tests/plugins/skyline.yml diff --git a/tests/plugins/sponsors/tests.yml b/tests/plugins/sponsors.yml similarity index 100% rename from tests/plugins/sponsors/tests.yml rename to tests/plugins/sponsors.yml diff --git a/tests/plugins/stackoverflow/tests.yml b/tests/plugins/stackoverflow.yml similarity index 100% rename from tests/plugins/stackoverflow/tests.yml rename to tests/plugins/stackoverflow.yml diff --git a/tests/plugins/stargazers/tests.yml b/tests/plugins/stargazers.yml similarity index 100% rename from tests/plugins/stargazers/tests.yml rename to tests/plugins/stargazers.yml diff --git a/tests/plugins/starlists/tests.yml b/tests/plugins/starlists.yml similarity index 100% rename from tests/plugins/starlists/tests.yml rename to tests/plugins/starlists.yml diff --git a/tests/plugins/stars/tests.yml b/tests/plugins/stars.yml similarity index 100% rename from tests/plugins/stars/tests.yml rename to tests/plugins/stars.yml diff --git a/tests/plugins/stock/tests.yml b/tests/plugins/stock.yml similarity index 100% rename from tests/plugins/stock/tests.yml rename to tests/plugins/stock.yml diff --git a/tests/plugins/support/tests.yml b/tests/plugins/support.yml similarity index 100% rename from tests/plugins/support/tests.yml rename to tests/plugins/support.yml diff --git a/tests/plugins/topics/tests.yml b/tests/plugins/topics.yml similarity index 100% rename from tests/plugins/topics/tests.yml rename to tests/plugins/topics.yml diff --git a/tests/plugins/traffic/tests.yml b/tests/plugins/traffic.yml similarity index 100% rename from tests/plugins/traffic/tests.yml rename to tests/plugins/traffic.yml diff --git a/tests/plugins/tweets/tests.yml b/tests/plugins/tweets.yml similarity index 100% rename from tests/plugins/tweets/tests.yml rename to tests/plugins/tweets.yml diff --git a/tests/plugins/wakatime/tests.yml b/tests/plugins/wakatime.yml similarity index 100% rename from tests/plugins/wakatime/tests.yml rename to tests/plugins/wakatime.yml