|
378 | 378 | (build/build (build/inputs (io/file inputs "data_readers_test")) opts cenv)
|
379 | 379 | (is (contains? (-> @cenv ::ana/data-readers) 'test/custom-identity))))
|
380 | 380 |
|
381 |
| -;(deftest test-node-modules-cljs-2246 |
382 |
| -; (test/delete-node-modules) |
383 |
| -; (spit (io/file "package.json") (json/json-str {:dependencies {:left-pad "1.1.3"} |
384 |
| -; :devDependencies {:module-deps "*" |
385 |
| -; :resolve "*" |
386 |
| -; :browser-resolve "*"}})) |
387 |
| -; (sh/sh "yarn" "install") |
388 |
| -; (let [ws (atom []) |
389 |
| -; out (.getPath (io/file (test/tmp-dir) "node-modules-opt-test-out")) |
390 |
| -; {:keys [inputs opts]} {:inputs (str (io/file "src" "test" "cljs_build")) |
391 |
| -; :opts {:main 'node-modules-opt-test.core |
392 |
| -; :output-dir out |
393 |
| -; :optimizations :none |
394 |
| -; :closure-warnings {:check-types :off}}} |
395 |
| -; cenv (env/default-compiler-env opts)] |
396 |
| -; (test/delete-out-files out) |
397 |
| -; (ana/with-warning-handlers [(collecting-warning-handler ws)] |
398 |
| -; (build/build (build/inputs (io/file inputs "node_modules_opt_test/core.cljs")) opts cenv)) |
399 |
| -; (is (.exists (io/file out "node_modules/left-pad/index.js"))) |
400 |
| -; (is (contains? (:js-module-index @cenv) "left-pad")) |
401 |
| -; (is (empty? @ws))) |
402 |
| -; (.delete (io/file "package.json")) |
403 |
| -; (.delete (io/file "yarn.lock")) |
404 |
| -; (test/delete-node-modules)) |
405 |
| - |
406 | 381 | (deftest test-cljs-2249
|
407 | 382 | (let [out (io/file (test/tmp-dir) "cljs-2249-out")
|
408 | 383 | root (io/file "src" "test" "cljs_build")
|
|
414 | 389 | (test/delete-out-files out)
|
415 | 390 | (closure/build (build/inputs (io/file root "foreign_libs_cljs_2249")) opts)
|
416 | 391 | (is (.exists (io/file out "calculator_global.js")))))
|
| 392 | + |
| 393 | +(deftest test-node-modules-cljs-2246 |
| 394 | + (test/delete-node-modules) |
| 395 | + (.delete (io/file "package-lock.json")) |
| 396 | + (spit (io/file "package.json") (json/json-str {:dependencies {:left-pad "1.1.3"} |
| 397 | + :devDependencies {:module-deps "*" |
| 398 | + :resolve "*" |
| 399 | + :browser-resolve "*"}})) |
| 400 | + (sh/sh "npm" "install") |
| 401 | + (let [ws (atom []) |
| 402 | + out (.getPath (io/file (test/tmp-dir) "node-modules-opt-test-out")) |
| 403 | + {:keys [inputs opts]} {:inputs (str (io/file "src" "test" "cljs_build")) |
| 404 | + :opts {:main 'node-modules-opt-test.core |
| 405 | + :output-dir out |
| 406 | + :optimizations :none |
| 407 | + :closure-warnings {:check-types :off}}} |
| 408 | + cenv (env/default-compiler-env opts)] |
| 409 | + (test/delete-out-files out) |
| 410 | + (ana/with-warning-handlers [(collecting-warning-handler ws)] |
| 411 | + (build/build (build/inputs (io/file inputs "node_modules_opt_test/core.cljs")) opts cenv)) |
| 412 | + (is (.exists (io/file out "node_modules/left-pad/index.js"))) |
| 413 | + (is (contains? (:js-module-index @cenv) "left-pad")) |
| 414 | + (is (empty? @ws))) |
| 415 | + (.delete (io/file "package.json")) |
| 416 | + (.delete (io/file "package-lock.json")) |
| 417 | + (test/delete-node-modules)) |
0 commit comments