diff --git a/packages/compartment-mapper/test/optional.test.js b/packages/compartment-mapper/test/optional.test.js index 8f5ea74779..61e9ab841d 100644 --- a/packages/compartment-mapper/test/optional.test.js +++ b/packages/compartment-mapper/test/optional.test.js @@ -15,7 +15,8 @@ const fixtureOptionalDepsCjs = new URL( scaffold( 'optionalDependencies/esm', - // this test fails because it relies on dynamic import + // fails for archives because dynamic import cannot reach modules not + // discovered during archival test, fixtureOptionalDepsEsm, async (t, { namespace }) => { @@ -41,7 +42,7 @@ scaffold( ); }, 4, - { knownFailure: true }, + { knownArchiveFailure: true }, ); scaffold( diff --git a/packages/compartment-mapper/test/scaffold.js b/packages/compartment-mapper/test/scaffold.js index aec454b739..6621648e36 100644 --- a/packages/compartment-mapper/test/scaffold.js +++ b/packages/compartment-mapper/test/scaffold.js @@ -93,6 +93,7 @@ export function scaffold( addGlobals = {}, policy, knownFailure = false, + knownArchiveFailure = false, tags = undefined, conditions = tags, strict = false, @@ -111,7 +112,10 @@ export function scaffold( // wrapping each time allows for convenient use of test.only const wrap = (testFunc, testCategoryHint) => (title, implementation) => { // mark as known failure if available (but fallback to support test.only) - if (knownFailure) { + if ( + knownFailure || + (knownArchiveFailure && testCategoryHint === 'Archive') + ) { testFunc = testFunc.failing || testFunc; } return testFunc(title, async t => {