Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Permit nodejs targets to have a preamble.
- Loading branch information
1 parent
e6f0f30
commit 4b7cdd4
Showing
4 changed files
with
24 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,21 @@ | ||
(ns cljs.closure-tests | ||
(:use cljs.closure) | ||
(:use clojure.test)) | ||
|
||
(deftest test-make-preamble | ||
(testing "no options" | ||
(is (= "" (make-preamble {})))) | ||
(testing "nodejs" | ||
(testing "with default hashbang" | ||
(is (= "#!/usr/bin/env node\n" (make-preamble {:target :nodejs})))) | ||
(testing "with custom hashbang" | ||
(is (= "#!/bin/env node\n" (make-preamble {:target :nodejs | ||
:hashbang "/bin/env node"})))) | ||
(testing "with preamble" | ||
(is (= "#!/usr/bin/env node\nvar preamble1 = require(\"preamble1\");\n" | ||
(make-preamble {:target :nodejs | ||
:preamble ["cljs/preamble1.js"]}))))) | ||
(testing "preamble" | ||
(is (= "var preamble1 = require(\"preamble1\");var preamble2 = require(\"preamble2\");\n" | ||
(make-preamble {:preamble ["cljs/preamble1.js" | ||
"cljs/preamble2.js"]}))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
var preamble1 = require("preamble1"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
var preamble2 = require("preamble2"); |