fix(tests): proper flag handling
This commit is contained in:
parent
45ba23e962
commit
4fa26061ee
1 changed files with 72 additions and 71 deletions
|
|
@ -1,12 +1,4 @@
|
|||
use std::fs;
|
||||
|
||||
use insta::{glob, Settings};
|
||||
|
||||
use sabry::{
|
||||
buildmagic::SabryBuilder,
|
||||
config::{BehavHashCollision, BehavSassModCollision, SabryConfig},
|
||||
sassy, styly, usey,
|
||||
};
|
||||
use sabry::styly;
|
||||
|
||||
pub mod sass {
|
||||
use sabry::sassy;
|
||||
|
|
@ -113,7 +105,15 @@ fn syntax_contract() {
|
|||
assert_eq!(sass::module_inline_a!(syntax), "sass");
|
||||
}
|
||||
|
||||
fn gen_config() -> SabryConfig {
|
||||
#[cfg(test)]
|
||||
#[cfg(all(feature = "procmacro", feature = "build"))]
|
||||
mod build_tests {
|
||||
use std::fs;
|
||||
|
||||
use insta::{glob, Settings};
|
||||
use sabry::{usey, buildmagic::SabryBuilder, config::{BehavHashCollision, BehavSassModCollision, SabryConfig}};
|
||||
|
||||
fn gen_config() -> SabryConfig {
|
||||
let mut config = SabryConfig::require().unwrap();
|
||||
config.css.bundle = Some("tests/sabry_output/bundle.css".into());
|
||||
config.css.scopes = Some("tests/sabry_output/scopes".into());
|
||||
|
|
@ -146,24 +146,24 @@ fn gen_config() -> SabryConfig {
|
|||
config.lightningcss.targets.samsung = Some("80".into());
|
||||
|
||||
config
|
||||
}
|
||||
}
|
||||
|
||||
fn gen_builder() -> SabryBuilder {
|
||||
fn gen_builder() -> SabryBuilder {
|
||||
let config = gen_config();
|
||||
let builder = SabryBuilder::new(config);
|
||||
|
||||
builder
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn compilation_with_buildy() {
|
||||
#[test]
|
||||
fn compilation_with_buildy() {
|
||||
let mut builder = gen_builder();
|
||||
builder
|
||||
.build(usey!(
|
||||
sass::mixins_a!(),
|
||||
sass::module_a!(),
|
||||
scss::mixins_c!(),
|
||||
scss::module_c!()
|
||||
super::sass::mixins_a!(),
|
||||
super::sass::module_a!(),
|
||||
super::scss::mixins_c!(),
|
||||
super::scss::module_c!()
|
||||
))
|
||||
.unwrap();
|
||||
|
||||
|
|
@ -179,4 +179,5 @@ fn compilation_with_buildy() {
|
|||
insta::assert_snapshot!(generated);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue