-
Notifications
You must be signed in to change notification settings - Fork 12
/
instrument_options.rs
49 lines (45 loc) · 1.58 KB
/
instrument_options.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
use istanbul_oxide::SourceMap;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase", default)]
pub struct InstrumentLogOptions {
pub level: Option<String>,
pub enable_trace: bool,
}
impl Default for InstrumentLogOptions {
fn default() -> Self {
InstrumentLogOptions {
level: None,
enable_trace: false,
}
}
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase", default)]
pub struct InstrumentOptions {
pub coverage_variable: String,
pub compact: bool,
pub report_logic: bool,
pub ignore_class_methods: Vec<String>,
pub input_source_map: Option<SourceMap>,
pub instrument_log: InstrumentLogOptions,
pub debug_initial_coverage_comment: bool,
// Allow to specify which files should be excluded from instrumentation.
// This option accepts an array of wax(https://crates.io/crates/wax)-compatible glob patterns
// and will match against the filename provided by swc's core.
pub unstable_exclude: Option<Vec<String>>,
}
impl Default for InstrumentOptions {
fn default() -> Self {
InstrumentOptions {
coverage_variable: "__coverage__".to_string(),
compact: false,
report_logic: false,
ignore_class_methods: Default::default(),
input_source_map: Default::default(),
instrument_log: Default::default(),
debug_initial_coverage_comment: false,
unstable_exclude: Default::default(),
}
}
}