Debian Codegraph @

tests/testthat/test-include-paths.R

raw
1 # Disable sass cache
2 local_disable_cache()
3
4 test_that("single path works", {
5 scss <- "@import \"need\""
6 css <- sass(scss, options = sass_options(include_path = "test-include-path/"))
7
8 actual <- read_utf8("test-include-path/_need.scss")
9 class(actual) <- c("css", "html", "character")
10 attr(actual, "html") <- TRUE
11
12 expect_equal(css, actual)
13 })
14
15 test_that("multiple paths work", {
16 scss <- "@import \"need\", \"need2\""
17 css <- sass(
18 scss,
19 options = sass_options(include_path = c("test-include-path/", "test-include-path2/"))
20 )
21
22 css1 <- read_utf8("test-include-path/_need.scss")
23 css2 <- read_utf8("test-include-path2/_need2.scss")
24 actual <- paste0(c(css1, css2), collapse = "\n")
25 class(actual) <- c("css", "html", "character")
26 attr(actual, "html") <- TRUE
27
28 expect_equal(css, actual)
29 })