Skip to content

Commit

Permalink
Updated tests based on feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
syrusakbary committed Oct 11, 2019
1 parent 64f8578 commit 182302b
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,25 @@ const isBoolean = function (value) {
return typeof value === 'boolean';
}

const checkFeature = function (featureName) {
const checkFeature = async function (featureName) {
const feature = features[featureName];
assert(feature, `The feature ${featureName} doesn't exist`);
feature().then(function(result) {
console.log(`The feature ${featureName} returned: ${result}`);
assert(isBoolean(result), `The feature ${featureName} returned: ${result}`);
})
const result = await feature();
console.log(`The feature ${featureName} returned: ${result}`);
assert(isBoolean(result), `The feature ${featureName} returned: ${result}`);
}

checkFeature("bulkMemory");
checkFeature("exceptions");
checkFeature("multiValue");
checkFeature("mutableGlobals");
checkFeature("referenceTypes");
checkFeature("saturatedFloatToInt");
checkFeature("signExtensions");
checkFeature("simd");
checkFeature("tailCall");
checkFeature("threads");
async function run() {
await checkFeature("bulkMemory");
await checkFeature("exceptions");
await checkFeature("multiValue");
await checkFeature("mutableGlobals");
await checkFeature("referenceTypes");
await checkFeature("saturatedFloatToInt");
await checkFeature("signExtensions");
await checkFeature("simd");
await checkFeature("tailCall");
await checkFeature("threads");
}

run();

0 comments on commit 182302b

Please sign in to comment.