Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion tests/e2e/cloak-runtime.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,16 @@ function browserRun(session: string, source: string, options: Parameters<typeof

async function createSession(options: Parameters<typeof runCli>[1] = {}) {
const result = await runCli(['session', 'create', '-f', 'json'], isolatedOptions(options));
expect(result.code).toBe(0);
expect(result.code, `${result.stdout}\n${result.stderr}`).toBe(0);
return JSON.parse(result.stdout).id as string;
}

beforeAll(async () => {
sharedConfigDir = fs.mkdtempSync(path.join(os.tmpdir(), 'webcmd-cloak-suite-'));
sharedProfile = `cloak-suite-${Date.now()}`;
sourceDirs.push(sharedConfigDir);
const created = await runCli(['profile', 'create', sharedProfile], isolatedOptions({ timeout: 120_000 }));
expect(created.code, `${created.stdout}\n${created.stderr}`).toBe(0);
server = http.createServer((req, res) => {
if (req.url === '/cookie') {
res.setHeader('Set-Cookie', 'webcmd_smoke=ok; Path=/');
Expand Down Expand Up @@ -111,6 +113,7 @@ describe('Cloak runtime e2e', () => {
WEBCMD_PROFILE: profile,
},
});
expect((await run(['profile', 'create', profile])).code).toBe(0);
const waitForStoppedDaemon = async () => {
let status = await run(['daemon', 'status']);
for (let attempt = 0; attempt < 20 && !status.stdout.includes('Daemon: not running'); attempt += 1) {
Expand Down
Loading