-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from bodo-run/e2e
Node.js E2E
- Loading branch information
Showing
3 changed files
with
79 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
use assert_cmd::Command; | ||
use predicates::prelude::*; | ||
use std::error::Error; | ||
use std::path::PathBuf; | ||
|
||
#[test] | ||
fn test_nodejs_ecosystem_e2e() -> Result<(), Box<dyn Error>> { | ||
let node_e2e_yaml = PathBuf::from(env!("CARGO_MANIFEST_DIR")) | ||
.join("tests") | ||
.join("test_files") | ||
.join("node_e2e.yaml"); | ||
|
||
let mut cmd = Command::cargo_bin("stop-nagging")?; | ||
cmd.arg("--yaml").arg(node_e2e_yaml.to_str().unwrap()); | ||
|
||
cmd.assert() | ||
.success() | ||
.stdout(predicate::str::contains("Skipping ecosystem: nodejs")) | ||
.stdout(predicate::str::contains( | ||
"All applicable nags have been disabled", | ||
)); | ||
|
||
Ok(()) | ||
} | ||
|
||
#[test] | ||
fn test_nodejs_ecosystem_ignore_tools() -> Result<(), Box<dyn Error>> { | ||
let node_e2e_yaml = PathBuf::from(env!("CARGO_MANIFEST_DIR")) | ||
.join("tests") | ||
.join("test_files") | ||
.join("node_e2e.yaml"); | ||
|
||
let mut cmd = Command::cargo_bin("stop-nagging")?; | ||
cmd.arg("--yaml") | ||
.arg(node_e2e_yaml.to_str().unwrap()) | ||
.arg("--ignore-tools") | ||
.arg("yarn,pnpm"); | ||
|
||
cmd.assert() | ||
.success() | ||
.stdout(predicate::str::contains("Skipping ecosystem: nodejs")) | ||
.stdout(predicate::str::contains( | ||
"All applicable nags have been disabled", | ||
)); | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
ecosystems: | ||
nodejs: | ||
tools: | ||
- name: "npm" | ||
executable: "npm" | ||
env: | ||
NPM_CONFIG_UPDATE_NOTIFIER: "false" | ||
commands: | ||
- "echo 'npm e2e command executed'" | ||
skip: false | ||
|
||
- name: "pnpm" | ||
executable: "pnpm" | ||
env: {} | ||
commands: | ||
- "echo 'pnpm e2e command executed'" | ||
skip: false | ||
|
||
- name: "yarn" | ||
executable: "yarn" | ||
env: | ||
YARN_IGNORE_PATH: "1" | ||
commands: | ||
- "echo 'yarn e2e command executed'" | ||
skip: false | ||
|
||
- name: "node" | ||
executable: "node" | ||
env: {} | ||
commands: | ||
- "echo 'node e2e command executed'" | ||
skip: false |