-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #63 from uosl/feature/unit-tests
Unit tests
- Loading branch information
Showing
18 changed files
with
202 additions
and
72 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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
**/.* | ||
node_modules | ||
bower_components | ||
resources/public/vendor | ||
test | ||
tests |
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,20 @@ | ||
language: java | ||
jdk: openjdk8 | ||
|
||
before_script: | ||
# Install lein - required to build the project | ||
- wget https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein -O /tmp/lein | ||
- chmod +x /tmp/lein | ||
- export PATH=$PATH:/tmp/lein | ||
# make several attempts at downloading dependencies | ||
- travis_retry lein deps | ||
# check code is well formatted | ||
- lein cljfmt check | ||
# setup node dependencies | ||
- npm install | ||
|
||
script: | ||
# Run unit tests | ||
- lein kaocha | ||
# ensure a minified build completes without error | ||
- lein uberjar |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/usr/bin/env bash | ||
lein kaocha "$@" |
This file was deleted.
Oops, something went wrong.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,5 +1,6 @@ | ||
{ | ||
"dependencies": { | ||
"@cljs-oss/module-deps": "^1.1.1" | ||
"@cljs-oss/module-deps": "^1.1.1", | ||
"ws": "^7.1.2" | ||
} | ||
} |
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
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
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,7 +1,46 @@ | ||
(ns im-tables.core-test | ||
(:require [cljs.test :refer-macros [deftest testing is]] | ||
[im-tables.core :as core])) | ||
(:require [cljs.test :refer-macros [deftest testing is use-fixtures]] | ||
[im-tables.test-utils :as utils] | ||
[re-frame.core :as rf] | ||
[day8.re-frame.test :refer-macros [run-test-sync run-test-async wait-for]] | ||
[im-tables.events] | ||
[im-tables.subs])) | ||
|
||
(deftest fake-test | ||
(testing "fake description" | ||
(is (= 1 2)))) | ||
(use-fixtures :each utils/fixtures) | ||
|
||
(def im-config {:service {:root "beta.humanmine.org/beta"} | ||
:query {:from "Gene" | ||
:select ["symbol" | ||
"secondaryIdentifier" | ||
"dataSets.description" | ||
"primaryIdentifier" | ||
"organism.name" | ||
"dataSets.name"]} | ||
:settings {:pagination {:limit 10} | ||
:links {:vocab {:mine "BananaMine"} | ||
:url (fn [vocab] (str "#/reportpage/" | ||
(:mine vocab) "/" | ||
(:class vocab) "/" | ||
(:id vocab)))}}}) | ||
|
||
(deftest load-im-tables | ||
(run-test-async | ||
(let [loc [:default]] | ||
(rf/dispatch-sync [:im-tables/load loc im-config]) | ||
(wait-for [:main/initial-query-response] | ||
(testing "im-table runs query" | ||
(let [response @(rf/subscribe [:main/query-response loc])] | ||
(is (some? response)))))))) | ||
|
||
(deftest column-summary | ||
(run-test-async | ||
(let [loc [:default]] | ||
(rf/dispatch-sync [:im-tables/load loc im-config]) | ||
(wait-for [:main/initial-query-response] | ||
(rf/dispatch-sync [:im-tables.main/init loc]) | ||
(wait-for [(utils/match-times {:main/save-column-summary 6 | ||
:main/save-decon-count 3})] | ||
(testing "at least one non-empty column summary" | ||
(let [summaries @(rf/subscribe [:summaries/column-summaries loc])] | ||
(is (some (every-pred map? not-empty) | ||
(map :response (vals summaries))))))))))) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.