Skip to content

Commit

Permalink
test: put cs tests behind env var
Browse files Browse the repository at this point in the history
  • Loading branch information
jost-s committed Nov 12, 2024
1 parent b9d9772 commit 904b619
Showing 1 changed file with 35 additions and 32 deletions.
67 changes: 35 additions & 32 deletions test/e2e/app-websocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,37 +315,40 @@ test(
})
);

test.only(
"countersigning session interaction calls",
withConductor(ADMIN_PORT, async (t) => {
const { client: appWs, cell_id } = await createAppWsAndInstallApp(
ADMIN_PORT
);

let response = await appWs.getCountersigningSessionState(cell_id);
console.log("response", response);
t.equals(response, null, "countersigning session state should be null");

try {
await appWs.abandonCountersigningSession(cell_id);
t.fail("there should not be a countersigning session to be abandoned");
} catch (error) {
assert(error instanceof Error);
t.assert(
error.message.includes("SessionNotFound"),
"there should not be a countersigning session"
// To test unstable features in Holochain, set env var `TEST_UNSTABLE` to `true`.
if (process.env.TEST_UNSTABLE === "true") {
test(
"countersigning session interaction calls",
withConductor(ADMIN_PORT, async (t) => {
const { client: appWs, cell_id } = await createAppWsAndInstallApp(
ADMIN_PORT
);
}

try {
await appWs.publishCountersigningSession(cell_id);
t.fail("there should not be a countersigning session to be published");
} catch (error) {
assert(error instanceof Error);
t.assert(
error.message.includes("SessionNotFound"),
"there should not be a countersigning session"
);
}
})
);
let response = await appWs.getCountersigningSessionState(cell_id);
console.log("response", response);
t.equals(response, null, "countersigning session state should be null");

try {
await appWs.abandonCountersigningSession(cell_id);
t.fail("there should not be a countersigning session to be abandoned");
} catch (error) {
assert(error instanceof Error);
t.assert(
error.message.includes("SessionNotFound"),
"there should not be a countersigning session"
);
}

try {
await appWs.publishCountersigningSession(cell_id);
t.fail("there should not be a countersigning session to be published");
} catch (error) {
assert(error instanceof Error);
t.assert(
error.message.includes("SessionNotFound"),
"there should not be a countersigning session"
);
}
})
);
}

0 comments on commit 904b619

Please sign in to comment.