Commit 81f164abae12c7d8322fc7f50bce445a4ad79b02

Michael Crumm 2021-09-21T16:18:53

Add compilation test

diff --git a/test/dart_sass_test.exs b/test/dart_sass_test.exs
index d00404e..82605a1 100644
--- a/test/dart_sass_test.exs
+++ b/test/dart_sass_test.exs
@@ -32,4 +32,11 @@ defmodule DartSassTest do
              assert DartSass.run(:default, ["--version"]) == 0
            end) =~ @version
   end
+
+  @tag :tmp_dir
+  test "compiles", %{tmp_dir: dir} do
+    dest = Path.join(dir, "app.css")
+    Mix.Task.rerun("sass", ["default", "--no-source-map", "test/fixtures/app.scss", dest])
+    assert File.read!(dest) == "body > p {\n  color: green;\n}\n"
+  end
 end
diff --git a/test/fixtures/app.scss b/test/fixtures/app.scss
new file mode 100644
index 0000000..85a660e
--- /dev/null
+++ b/test/fixtures/app.scss
@@ -0,0 +1,5 @@
+body {
+  &>p {
+    color: green;
+  }
+}