Skip to content

Commit 5bb08b1

Browse files
committed
added extra tests, checking covr, issue #2
1 parent d3b563b commit 5bb08b1

5 files changed

Lines changed: 1717 additions & 17 deletions

File tree

tests/testthat.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@
99
library(testthat)
1010
library(ggplot2)
1111
library(OmicFlow)
12+
library(patchwork)
1213

1314
test_check("OmicFlow")

tests/testthat/_snaps/autoflow/report.html

Lines changed: 1699 additions & 0 deletions
Large diffs are not rendered by default.
60.1 KB
Binary file not shown.

tests/testthat/test-autoflow.R

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
# test_that("Testing autoFlow while ignoring dynamic date", {
2-
# taxa <- metagenomics$new(
3-
# biomData = "input/metagenomics/biom_with_taxonomy_hdf5.biom",
4-
# metaData = "input/metagenomics/metadata.tsv",
5-
# treeData = "input/metagenomics/rooted_tree.newick"
6-
# )
1+
test_that("Testing autoFlow while ignoring dynamic date", {
2+
taxa <- metagenomics$new(
3+
biomData = "input/metagenomics/biom_with_taxonomy_hdf5.biom",
4+
metaData = "input/metagenomics/metadata.tsv",
5+
treeData = "input/metagenomics/rooted_tree.newick"
6+
)
77

8-
# taxa$autoFlow(filename = paste0(getwd(), "/report.html"))
8+
taxa$autoFlow(filename = paste0(getwd(), "/report.html"))
99

10-
# # Define a transform function to replace dates (e.g., YYYY-MM-DD) with a placeholder
11-
# transform_fn <- function(x) {
12-
# gsub("\\d{4}-\\d{2}-\\d{2}", "<DATE>", x)
13-
# }
10+
# Define a transform function to replace dates (e.g., YYYY-MM-DD) with a placeholder
11+
transform_fn <- function(x) {
12+
gsub("\\d{4}-\\d{2}-\\d{2}", "<DATE>", x)
13+
}
1414

15-
# expect_snapshot_file("report.html", transform = transform_fn)
16-
# file.remove("report.html")
17-
# })
15+
expect_snapshot_file("report.html", transform = transform_fn)
16+
file.remove("report.html")
17+
})

tests/testthat/test-metagenomics.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ test_that("Testing Metagenomics reading and writing of BIOM files", {
1212
featureData = taxa_hdf5$featureData
1313
)
1414

15-
# taxa_ref$write_biom(filename = "test.biom")
15+
taxa_ref$write_biom(filename = "test.biom")
1616

17-
# expect_snapshot_file("test.biom")
18-
# file.remove("test.biom") # Cant create an existing file
17+
expect_snapshot_file("test.biom")
18+
file.remove("test.biom") # Cant create an existing file
1919
expect_snapshot(taxa_hdf5)
2020
expect_snapshot(taxa_ref)
2121
})

0 commit comments

Comments
 (0)