Skip to content

Commit

Permalink
Simplify singleton tests by removing the loop
Browse files Browse the repository at this point in the history
  • Loading branch information
Robin Neatherway committed Jun 26, 2020
1 parent bb9ed79 commit a0d4330
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 17 deletions.
12 changes: 4 additions & 8 deletions lib/util.test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/util.test.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 4 additions & 8 deletions src/util.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,11 @@ test('getThreadsFlag() should return the correct --threads flag', t => {
});

test('getThreadsFlag() throws if the ram input is < 0 or NaN', t => {
for (const input of ["hello!"]) {
process.env['INPUT_THREADS'] = input;
t.throws(util.getThreadsFlag);
}
process.env['INPUT_THREADS'] = "hello!";
t.throws(util.getThreadsFlag);
});

test('getRef() throws on the empty string', t => {
for (const input of [""]) {
process.env["GITHUB_REF"] = input;
t.throws(util.getRef);
}
process.env["GITHUB_REF"] = "";
t.throws(util.getRef);
});

0 comments on commit a0d4330

Please sign in to comment.