Skip to content

Commit

Permalink
Tests: minor adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
rwaldron committed May 11, 2021
1 parent d9af197 commit 78c86ae
Showing 1 changed file with 9 additions and 21 deletions.
30 changes: 9 additions & 21 deletions test/runify.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,6 @@ hosts.forEach(function (record) {
return;
}

beforeAll(() => {
// run = this;
if (type === "remote") {
// run.timeout(60 * 1000);
}
});

beforeEach(async () => {
agent = await eshost.createAgent(type, options);
});
Expand Down Expand Up @@ -407,17 +400,15 @@ hosts.forEach(function (record) {
return;
}

const resultP = agent.evalScript(
stripIndent`while (true) { }; print(2);`
);
await timeout(10);

const stopP = agent.stop();
const resultP = agent.evalScript(stripIndent`while (true) { }; print(2);`);
return timeout(100).then(() => {
const stopP = agent.stop();

const outcomes = await Promise.all([resultP, stopP]);
const result = outcomes[0];

expect(!result.stdout.match(/2/)).toBeTruthy();
return Promise.all([resultP, stopP]);
}).then(record => {
const result = record[0];
assert(!result.stdout.match(/2/), `Unexpected stdout: ${result.stdout}`);
});
});

it("tolerates LINE SEPARATOR and PARAGRAPH SEPARATOR", async () => {
Expand Down Expand Up @@ -754,9 +745,6 @@ hosts.forEach(function (record) {
});

it("Can evaluate module code", async () => {
// 60 seconds should be enough.
// run.timeout(60000);

return Promise.all(
records.map(async (record) => {
let options = record.attrs.flags;
Expand All @@ -778,7 +766,7 @@ hosts.forEach(function (record) {
}
})
);
});
}, 60_000);
});

describe('"shortName" option', () => {
Expand Down

0 comments on commit 78c86ae

Please sign in to comment.