This commit is contained in:
Mateusz Gruszczyński committed 2026-10-04 11:15:58 +02:00
1 parent 87e571c170
commit fa7abc9e53
308 files changed
+49746 -50237

No files matched your search

+1 -18
View File
@@ -120,21 +120,4 @@ pub fn minify(body: &[u8]) -> Result<Vec<u8>> {
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn keeps_regex_literals_and_asi_sensitive_newlines() {
let input = b"const r = /a b[/*]/; // keep\nreturn value;\n";
let output = String::from_utf8(minify(input).unwrap()).unwrap();
assert!(output.contains("/a b[/*]/; // keep"));
assert!(output.contains("return value"));
}
#[test]
fn keeps_template_literal_whitespace() {
let input = b"const x = `a b ${ value }`;\n";
let output = String::from_utf8(minify(input).unwrap()).unwrap();
assert_eq!(output, "const x = `a b ${ value }`;\n");
}
}
include!("js/tests.rs");