Просмотр исходного кода

Add test for custom.js to export_test.cljs

Candide U 2 лет назад
Родитель
Сommit
fd8bb11c37
1 измененных файлов с 10 добавлено и 0 удалено
  1. 10 0
      deps/publishing/test/logseq/publishing/export_test.cljs

+ 10 - 0
deps/publishing/test/logseq/publishing/export_test.cljs

@@ -97,6 +97,16 @@
                 (str (fs/readFileSync "tmp/published-graph/static/css/export.css")))
              "export.css is copied correctly")))
 
+(deftest-async create-export-with-js-files
+  (create-static-dir "tmp/static")
+  (create-logseq-graph "tmp/test-graph")
+  (fs/writeFileSync "tmp/test-graph/logseq/custom.js" "// foo")
+
+  (p/let [_ (create-export "tmp/static" "tmp/test-graph" "tmp/published-graph" {})]
+         (is (= "// foo"
+                (str (fs/readFileSync "tmp/published-graph/static/js/custom.js")))
+             "custom.js is copied correctly")))
+
 (deftest-async create-export-with-assets
   (create-static-dir "tmp/static")
   (create-logseq-graph "tmp/test-graph")