Skip to content

Commit

Permalink
test: fallback to Object.keys for Node v6
Browse files Browse the repository at this point in the history
  • Loading branch information
gajus committed Jun 6, 2017
1 parent 0ac22b5 commit 5a396c4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/utilities/mapFlowTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,15 @@ const knownTypes = {
};

test('correctly maps known types', (t) => {
for (const [databaseType, flowType] of Object.entries(knownTypes)) {
const databaseTypeNames = Object.keys(knownTypes);

for (const databaseTypeName of databaseTypeNames) {
const flowType = knownTypes[databaseTypeName];

if (typeof flowType !== 'string') {
throw new TypeError();
}

t.true(mapFlowType(databaseType) === flowType, flowType);
t.true(mapFlowType(databaseTypeName) === flowType, flowType);
}
});

0 comments on commit 5a396c4

Please sign in to comment.