Add NO_EXTERNAL_TEST flag to skip tests using external APIs

Adds an externalTest(this) helper alongside slowTest that skips the test
when NO_EXTERNAL_TEST is set and raises the timeout to 60s, plus a
no-external-test script. Marks the tests hitting factorio.com, the mod
portal and GitHub with it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
bbassieandClaude Fable 5 committed 2026-08-18 19:55:18 +00:00
1 parent 0be4fd77e5
commit 0cfa048d42
8 files changed
+34 -6

No files matched your search

+2 -1
View File
@@ -1,7 +1,7 @@
const assert = require("assert").strict;
const { fetchLatestReleases, resolveReleaseChannel } = require("@clusterio/lib");
const { slowTest } = require("../../integration");
const { slowTest, externalTest } = require("../../integration");
describe("LatestReleases", function() {
describe("fetchLatestReleases", function() {
@@ -54,6 +54,7 @@ describe("LatestReleases", function() {
});
it("fetches from the live api", async function() {
slowTest(this);
externalTest(this);
global.fetch = originalFetch;
const releases = await fetchLatestReleases();