feat(lanes): add isIntegrationEnabled toggle check (F3a)
This commit is contained in:
@@ -111,3 +111,32 @@ describe("resolveProfile — E2 declarations", () => {
|
||||
assert.deepEqual(profile.generatedMergePaths, ["api/openapi.json", "api/client.ts"]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("isIntegrationEnabled", () => {
|
||||
it("returns false when integrations.env doesn't exist at all", () => {
|
||||
const lane = makeLane();
|
||||
writeProfile(lane.cwd, "PORTS=api\n");
|
||||
assert.equal(profileLib.isIntegrationEnabled(lanesLib.getLane(lane.id), "tracker"), false);
|
||||
});
|
||||
|
||||
it("returns true when <NAME>_ENABLED=1 is set", () => {
|
||||
const lane = makeLane();
|
||||
writeProfile(lane.cwd, "PORTS=api\n");
|
||||
fsMod.writeFileSync(
|
||||
pathMod.join(lane.cwd, ".ccam", "profile", "integrations.env"),
|
||||
"TRACKER_ENABLED=1\nTRACKER_PROJECT=demo\n"
|
||||
);
|
||||
assert.equal(profileLib.isIntegrationEnabled(lanesLib.getLane(lane.id), "tracker"), true);
|
||||
});
|
||||
|
||||
it("returns false when the flag is 0 or absent from an existing file", () => {
|
||||
const lane = makeLane();
|
||||
writeProfile(lane.cwd, "PORTS=api\n");
|
||||
fsMod.writeFileSync(
|
||||
pathMod.join(lane.cwd, ".ccam", "profile", "integrations.env"),
|
||||
"DEV_QC_ENABLED=0\n"
|
||||
);
|
||||
assert.equal(profileLib.isIntegrationEnabled(lanesLib.getLane(lane.id), "dev_qc"), false);
|
||||
assert.equal(profileLib.isIntegrationEnabled(lanesLib.getLane(lane.id), "ci_wait"), false);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user