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