Skip to content

Commit

Permalink
Use Object.entries() instead of checking hasOwnProperty
Browse files Browse the repository at this point in the history
Co-authored-by: Robert <robertbrignull@github.com>
  • Loading branch information
2 people authored and GitHub committed Jun 19, 2020
1 parent 5eccb79 commit 34c941d
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions src/setup-tools.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,14 @@ test('parse codeql bundle url version', t => {
'1.2.3-beta.1': '1.2.3-beta.1',
};

for (const version in tests) {
if (tests.hasOwnProperty(version)) {

const expectedVersion = tests[version];
const url = `https://github.com/.../codeql-bundle-${version}/...`;

try {
const parsedVersion = setupTools.getCodeQLURLVersion(url);
t.deepEqual(parsedVersion, expectedVersion);
} catch (e) {
t.fail(e.message);
}
for (const [version, expectedVersion] of Object.entries(tests)) {
const url = `https://github.com/.../codeql-bundle-${version}/...`;

try {
const parsedVersion = setupTools.getCodeQLURLVersion(url);
t.deepEqual(parsedVersion, expectedVersion);
} catch (e) {
t.fail(e.message);
}
}
});

0 comments on commit 34c941d

Please sign in to comment.