mean(pwr_test.imbal) <= alpha + eps is not TRUE

`actual`:   FALSE
`expected`: TRUE

test_that("reject null when balanced and ATE", {
res <- cb.detect.caus_cdcorr(sim.high$Ys, sim.high$Ts, sim.high$Xs,
test_that("reject null when imbalanced and ATE", {
res <- cb.detect.caus_cdcorr(sim.low$Ys, sim.low$Ts, sim.low$Xs, R=100)
test_that("typically fails to reject null when balanced and ATE=0", {
pwr_test <- sapply(1:nrep, function(i) {
# should falsely reject null in favor of alternative at a rate ~alpha + small
expect_true(mean(pwr_test) <= alpha + eps)
test_that("typically fails to reject null when imbalanced and ATE=0", {
sim.low <- cb.sims.sim_linear(n=100, unbalancedness = 1.5, null=TRUE)
res <- cb.detect.caus_cdcorr(sim.low$Ys, sim.low$Ts, sim.low$Xs,
test_that("works when covariates are given as a vector", {
res <- cb.detect.caus_cdcorr(sim.high$Ys, sim.high$Ts, as.vector(sim.high$Xs), R=100)
test_that("works with >1 covariate levels", {
test_that("rejects null with non-linearities and ATE", {
test_that("fails to reject null with non-linearities and no ATE", {
pwr_test.bal <- sapply(1:nrep, function(i) {
expect_true(mean(pwr_test.bal) <= alpha + eps)
pwr_test.imbal <- sapply(1:nrep, function(i) {
sim.low <- cb.sims.sim_sigmoid(n=100, unbalancedness = 1.5, null=TRUE)
expect_true(mean(pwr_test.imbal) <= alpha + eps)
test_that("throws error when no samples are retained", {
sim.low <- cb.sims.sim_linear(n=100, unbalancedness = 10)
test_that("raises warning when few samples are retained", {
sim.low <- cb.sims.sim_linear(n=100, unbalancedness = 3)

"typically fails to reject null when balanced and ATE=0"
"typically fails to reject null when imbalanced and ATE=0"
"works when covariates are given as a vector"
"rejects null with non-linearities and ATE"
"fails to reject null with non-linearities and no ATE"
"throws error when no samples are retained"
"raises warning when few samples are retained"

fails to reject null with non-linearities and no ATE