Use Object.entries() instead of checking hasOwnProperty

Co-authored-by: Robert <robertbrignull@github.com>
This commit is contained in:
Alex Kalyvitis 2020-06-19 13:27:45 +02:00 committed by GitHub
parent 5eccb79587
commit 34c941dc31
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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