Skip to content

Commit 227fccb

Browse files
committed
Add start of normative test flag support.
- Checking for flag. - Unsure how to use, but some code exists for future use.
1 parent e1e6782 commit 227fccb

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/test-common.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,8 @@ function addTest(manifest, test, tests) {
520520
}
521521

522522
const testOptions = getJsonLdValues(test, 'option');
523+
// allow special handling in case of normative test failures
524+
let normativeTest = true;
523525

524526
testOptions.forEach(function(opt) {
525527
const processingModes = getJsonLdValues(opt, 'processingMode');
@@ -555,6 +557,13 @@ function addTest(manifest, test, tests) {
555557
});
556558
});
557559

560+
testOptions.forEach(function(opt) {
561+
const normative = getJsonLdValues(opt, 'normative');
562+
normative.forEach(function(n) {
563+
normativeTest = normativeTest && n;
564+
});
565+
});
566+
558567
const fn = testInfo.fn;
559568
const params = testInfo.params.map(param => param(test));
560569
// resolve test data
@@ -608,6 +617,16 @@ function addTest(manifest, test, tests) {
608617
});
609618
}
610619
} catch(err) {
620+
// FIXME: improve handling of non-normative errors
621+
// FIXME: for now, explicitly disabling tests.
622+
//if(!normativeTest) {
623+
// // failure ok
624+
// if(options.verboseSkip) {
625+
// console.log('Skipping non-normative test due to failure:',
626+
// {id: test['@id'], name: test.name});
627+
// }
628+
// self.skip();
629+
//}
611630
if(options.bailOnError) {
612631
if(err.name !== 'AssertionError') {
613632
console.error('\nError: ', JSON.stringify(err, null, 2));

0 commit comments

Comments
 (0)