Mise en place projet R
This commit is contained in:
Executable
+9
@@ -0,0 +1,9 @@
|
||||
suppressPackageStartupMessages({ library(testthat) })
|
||||
source(file.path('R','project','calculations.R'), local = TRUE)
|
||||
|
||||
test_that('compute_metrics calcule correctement la moyenne', {
|
||||
df <- data.frame(value = c(1,2,3,4))
|
||||
res <- compute_metrics(df)
|
||||
expect_equal(res$mean, 2.5)
|
||||
expect_equal(res$n, 4)
|
||||
})
|
||||
Executable
+3
@@ -0,0 +1,3 @@
|
||||
# Placeholder pour tests DB (mockez ou utilisez une DB de test)
|
||||
suppressPackageStartupMessages({ library(testthat) })
|
||||
test_that('placeholder db', { expect_true(TRUE) })
|
||||
Executable
+3
@@ -0,0 +1,3 @@
|
||||
# Placeholder pour tests de webservices génériques
|
||||
suppressPackageStartupMessages({ library(testthat) })
|
||||
test_that('placeholder ws', { expect_true(TRUE) })
|
||||
Reference in New Issue
Block a user