-
Notifications
You must be signed in to change notification settings - Fork 421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: exclude content of UI assets from comparison in html output tests #4037
base: master
Are you sure you want to change the base?
Conversation
val excludedFiles = listOf( | ||
"ui-kit/ui-kit.min.js", | ||
"ui-kit/ui-kit.min.css", | ||
"styles/main.css", | ||
"scripts/main.js", | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might it be a good idea to create a global variable dokkaHtmlStyleFiles: List<String>
, so if they need to be changed they can be updated in all tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -20,8 +20,8 @@ import kotlin.io.path.* | |||
* | |||
* Only files will be compared, directories are ignored. | |||
*/ | |||
infix fun Path.shouldBeADirectoryWithSameContentAs(path: Path) { | |||
val differences = describeFileDifferences(this, path) | |||
fun Path.shouldBeADirectoryWithSameContentAs(path: Path, excludeFiles: List<String> = emptyList()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
excludeFiles
will completely exclude the files from the comparison. Maybe it would be better to exclude checking the file's content instead? That way we can still check that the files exist, but the actual styling isn't relevant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved the check inside the contents comparison part
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I think it'd be a good idea to update the variable name too, to be more descriptive. wdyt?
E.g. filesExcludedFromContentCheck
da066e2
to
43a296e
Compare
8da1a5b
to
bbe0c4b
Compare
bbe0c4b
to
4a6bc41
Compare
dokka-integration-tests/gradle/src/main/kotlin/org/jetbrains/dokka/it/gradle/TestConstants.kt
Outdated
Show resolved
Hide resolved
…okka/it/gradle/TestConstants.kt Co-authored-by: Adam <[email protected]>
No description provided.