summaryrefslogtreecommitdiffstats
path: root/tests/testsuite/nodejs.rs
diff options
context:
space:
mode:
authorNeil Kistner <neil.kistner@gmail.com>2019-09-09 18:14:38 -0500
committerMatan Kushner <hello@matchai.me>2019-09-09 19:14:38 -0400
commit9f70ffb7a7d2eeef64c360c553e909d38e44adf0 (patch)
tree4dccf8a935e027dcf7bc77781eed1554a645d72a /tests/testsuite/nodejs.rs
parentdc8409333e194624896c74c5e5cdb4f664f53f9d (diff)
fix: Lazy load git repo and only run module if not disabled (#306)
A couple of optimizations are done in this PR. One, we now will check config ahead of time to see if a module is disabled before running any module code. Also, we won't try to discover a git repository unless the module requests access to it.
Diffstat (limited to 'tests/testsuite/nodejs.rs')
-rw-r--r--tests/testsuite/nodejs.rs23
1 files changed, 1 insertions, 22 deletions
diff --git a/tests/testsuite/nodejs.rs b/tests/testsuite/nodejs.rs
index bea6248a1..33b0df2af 100644
--- a/tests/testsuite/nodejs.rs
+++ b/tests/testsuite/nodejs.rs
@@ -2,7 +2,7 @@ use ansi_term::Color;
use std::fs::{self, File};
use std::io;
-use crate::common::{self, TestCommand};
+use crate::common;
#[test]
fn folder_without_node_files() -> io::Result<()> {
@@ -70,24 +70,3 @@ fn folder_with_node_modules() -> io::Result<()> {
assert_eq!(expected, actual);
Ok(())
}
-
-#[test]
-#[ignore]
-fn config_disabled() -> io::Result<()> {
- let dir = common::new_tempdir()?;
- File::create(dir.path().join("package.json"))?;
-
- let output = common::render_module("nodejs")
- .use_config(toml::toml! {
- [nodejs]
- disabled = true
- })
- .arg("--path")
- .arg(dir.path())
- .output()?;
- let actual = String::from_utf8(output.stdout).unwrap();
-
- let expected = "";
- assert_eq!(expected, actual);
- Ok(())
-}