Skip to content

Commit

Permalink
Add conditional check for GITHUB_ACTIONS in command test suite
Browse files Browse the repository at this point in the history
Add conditional check for GITHUB_ACTIONS to skip a test case that is not
relevant when running in a GitHub Actions environment.

Generated by gpt-3.5-turbo
  • Loading branch information
joone committed Feb 24, 2024
1 parent d169fe1 commit f0facd5
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions test/command.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,14 @@ describe("Linux Command Test", () => {
expect(stdout).to.include("VGA compatible controller");
});

it("Run find . -type f -exec ls -l {} + | sort -k 5 -nr | head -n 1", function () {
let stdout = execSync(
`MOCHA_ENV=test node ${LOZ_BIN} "find the largest file in the current directory"`
).toString();
expect(stdout).to.include("typescript.js");
});
if (GITHUB_ACTIONS === false) {
it("Run find . -type f -exec ls -l {} + | sort -k 5 -nr | head -n 1", function () {
let stdout = execSync(
`MOCHA_ENV=test node ${LOZ_BIN} "find the largest file in the current directory"`
).toString();
expect(stdout).to.include("typescript.js");
});
}

it("Run systemctl status apache2", function () {
let stdout = execSync(
Expand Down

0 comments on commit f0facd5

Please sign in to comment.