Last active
October 29, 2017 02:50
-
-
Save olivergeorge/0e9e02eafdc2da62ca781c38d32d3bae to your computer and use it in GitHub Desktop.
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
(ns can-i-stub.main | |
(:require [cljs.nodejs :as nodejs] | |
[cljs.spec.alpha :as s] | |
[clojure.spec.test.alpha :as stest])) | |
(nodejs/enable-util-print!) | |
(defn add2 [a b] 10.1) | |
(s/fdef add2 :args (s/cat :a int? :b int?) :ret int?) | |
(defn -main [& args] | |
(println ::a (add2 1 2)) | |
(stest/instrument `add2 {:stub #{`add2}}) | |
(println ::b (add2 1 2)) | |
(stest/unstrument `add2) | |
(println ::c (add2 1 2))) | |
(set! *main-cli-fn* -main) |
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
(require 'cljs.build.api) | |
(cljs.build.api/build | |
"src" | |
{:main 'can-i-stub.main | |
:output-to "main.js" | |
:target :nodejs}) |
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
(defproject can-i-stub "0.1.0-SNAPSHOT" | |
:description "FIXME: write this!" | |
:url "http://example.com/FIXME" | |
:dependencies [[org.clojure/clojure "1.9.0-beta3"] | |
[org.clojure/clojurescript "1.9.946"] | |
[org.clojure/test.check "0.9.0"]] | |
:jvm-opts ^:replace ["-Xmx1g" "-server"] | |
:plugins [[lein-npm "0.6.2"]] | |
:npm {:dependencies [[source-map-support "0.4.0"]]} | |
:source-paths ["src" "target/classes"] | |
:clean-targets ["out" "release"] | |
:target-path "target") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment