@ -201,6 +201,14 @@ describe('build/transforms/remove-fenced-code', () => {
) ,
) ,
) . toStrictEqual ( testData . validOutputs [ buildType ] ) ;
) . toStrictEqual ( testData . validOutputs [ buildType ] ) ;
expect (
removeFencedCode (
mockFileName ,
buildType ,
testData . validInputs . extraContentWithFences ,
) ,
) . toStrictEqual ( testData . validOutputsWithExtraContent [ buildType ] ) ;
// Ensure that the minimal input template is in fact valid
// Ensure that the minimal input template is in fact valid
const minimalInput = getMinimalFencedCode ( buildType ) ;
const minimalInput = getMinimalFencedCode ( buildType ) ;
expect (
expect (
@ -216,6 +224,17 @@ describe('build/transforms/remove-fenced-code', () => {
testData . validInputs . withoutFences ,
testData . validInputs . withoutFences ,
) ,
) ,
) . toStrictEqual ( [ testData . validInputs . withoutFences , false ] ) ;
) . toStrictEqual ( [ testData . validInputs . withoutFences , false ] ) ;
expect (
removeFencedCode (
mockFileName ,
buildType ,
testData . validInputs . extraContentWithoutFences ,
) ,
) . toStrictEqual ( [
testData . validInputs . extraContentWithoutFences ,
false ,
] ) ;
} ) ;
} ) ;
} ) ;
} ) ;
@ -611,6 +630,43 @@ Conditionally_Included
///: END:ONLY_INCLUDE_IN
///: END:ONLY_INCLUDE_IN
` ,
` ,
extraContentWithFences : `
///: BEGIN:ONLY_INCLUDE_IN(flask,beta)
Conditionally _Included
///: END:ONLY_INCLUDE_IN
Always _Included
Always _Included
Always _Included
Always _Included
///: BEGIN:ONLY_INCLUDE_IN(flask,beta)
Conditionally _Included
Conditionally _Included
Conditionally _Included
///: END:ONLY_INCLUDE_IN
Always _Included
Always _Included
Always _Included
///: BEGIN:ONLY_INCLUDE_IN(flask)
Conditionally _Included
Conditionally _Included
///: END:ONLY_INCLUDE_IN
Always _Included
Always _Included
Always _Included
///: BEGIN:ONLY_INCLUDE_IN(flask)
Conditionally _Included
Conditionally _Included
///: END:ONLY_INCLUDE_IN
Always _Included
Always _Included
Always _Included
` ,
withoutFences : `
withoutFences : `
Always _Included
Always _Included
Always _Included
Always _Included
@ -624,6 +680,24 @@ Always_Included
Always _Included
Always _Included
Always _Included
Always _Included
` ,
extraContentWithoutFences : `
Always _Included
Always _Included
Always _Included
Always _Included
Always _Included
Always _Included
Always _Included
Always _Included
Always _Included
Always _Included
Always _Included
Always _Included
Always _Included
` ,
` ,
} ,
} ,
@ -651,6 +725,38 @@ Always_Included
Always _Included
Always _Included
Always _Included
Always _Included
` ,
true ,
] ,
} ,
validOutputsWithExtraContent : {
beta : [
`
///: BEGIN:ONLY_INCLUDE_IN(flask,beta)
Conditionally _Included
///: END:ONLY_INCLUDE_IN
Always _Included
Always _Included
Always _Included
Always _Included
///: BEGIN:ONLY_INCLUDE_IN(flask,beta)
Conditionally _Included
Conditionally _Included
Conditionally _Included
///: END:ONLY_INCLUDE_IN
Always _Included
Always _Included
Always _Included
Always _Included
Always _Included
Always _Included
Always _Included
Always _Included
Always _Included
` ,
` ,
true ,
true ,
] ,
] ,
@ -659,5 +765,14 @@ Always_Included
data . validOutputs . flask = [ data . validInputs . withFences , false ] ;
data . validOutputs . flask = [ data . validInputs . withFences , false ] ;
data . validOutputs . main = [ data . validInputs . withoutFences , true ] ;
data . validOutputs . main = [ data . validInputs . withoutFences , true ] ;
data . validOutputsWithExtraContent . flask = [
data . validInputs . extraContentWithFences ,
false ,
] ;
data . validOutputsWithExtraContent . main = [
data . validInputs . extraContentWithoutFences ,
true ,
] ;
return deepFreeze ( data ) ;
return deepFreeze ( data ) ;
}
}