diff options
Diffstat (limited to 'resources/resource_transformers/tocss/dartsass/dartsass_integration_test.go')
-rw-r--r-- | resources/resource_transformers/tocss/dartsass/dartsass_integration_test.go | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/resources/resource_transformers/tocss/dartsass/dartsass_integration_test.go b/resources/resource_transformers/tocss/dartsass/dartsass_integration_test.go index dd4c1e5ca..4d48b3b6a 100644 --- a/resources/resource_transformers/tocss/dartsass/dartsass_integration_test.go +++ b/resources/resource_transformers/tocss/dartsass/dartsass_integration_test.go @@ -19,6 +19,7 @@ import ( "github.com/bep/logg" qt "github.com/frankban/quicktest" + "github.com/gohugoio/hugo/htesting" "github.com/gohugoio/hugo/hugolib" "github.com/gohugoio/hugo/resources/resource_transformers/tocss/dartsass" ) @@ -525,3 +526,39 @@ T1: {{ $r.Content }} b.AssertLogMatches(`Dart Sass: .*assets.*main.scss:13:0: number`) b.AssertLogMatches(`Dart Sass: .*assets.*main.scss:14:0: number`) } + +// Note: This test is more or less duplicated in both of the SCSS packages (libsass and dartsass). +func TestBootstrap(t *testing.T) { + t.Parallel() + if !dartsass.Supports() { + t.Skip() + } + if !htesting.IsCI() { + t.Skip("skip (slow) test in non-CI environment") + } + + files := ` +-- hugo.toml -- +disableKinds = ["term", "taxonomy", "section", "page"] +[module] +[[module.imports]] +path="github.com/gohugoio/hugo-mod-bootstrap-scss/v5" +-- go.mod -- +module github.com/gohugoio/tests/testHugoModules +-- assets/scss/main.scss -- +@import "bootstrap/bootstrap"; +-- layouts/index.html -- +{{ $cssOpts := (dict "transpiler" "dartsass" ) }} +{{ $r := resources.Get "scss/main.scss" | toCSS $cssOpts }} +Styles: {{ $r.RelPermalink }} + ` + + b := hugolib.NewIntegrationTestBuilder( + hugolib.IntegrationTestConfig{ + T: t, + TxtarString: files, + NeedsOsFS: true, + }).Build() + + b.AssertFileContent("public/index.html", "Styles: /scss/main.css") +} |