Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
gadenbuie committed Feb 3, 2021
1 parent 15c7621 commit b01bd22
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions tests/testthat/test-exercise.R
Original file line number Diff line number Diff line change
Expand Up @@ -223,22 +223,21 @@ test_that("serialized exercises produce equivalent evaluate_exercise() results",

test_that("filter_dependencies() excludes non-list knit_meta objects", {
ex <- mock_exercise(
user_code = deparse(quote(
htmltools::tagList(
htmltools::tags$head(htmltools::tags$style(".leaflet-container {backround:#FFF}")),
html_dependency_jquery()
)
))
user_code =
"htmltools::tagList(
htmltools::tags$head(htmltools::tags$style(\".leaflet-container {backround:#FFF}\")),
idb_html_dependency()
)"
)

ex_res <- expect_silent(render_exercise(ex, new.env()))
ex_res <- expect_silent(withr::with_tempdir(render_exercise(ex, new.env())))

ex_res_html_deps <- htmltools::htmlDependencies(ex_res$html_output)
# The head(style) dependency is dropped because it's not from a package
expect_equal(length(ex_res_html_deps), 1L)
# But we keep the dependency that came from a pkg
expect_equal(
ex_res_html_deps[[1]],
html_dependency_jquery()
idb_html_dependency()
)
})

0 comments on commit b01bd22

Please sign in to comment.