Skip to content

Commit

Permalink
yolo
Browse files Browse the repository at this point in the history
  • Loading branch information
seren5240 committed Mar 9, 2024
1 parent deb6b23 commit 6a6951b
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 15 deletions.
29 changes: 29 additions & 0 deletions crates/cli/fixtures/check_level/.grit/grit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: 0.0.3
patterns:
- name: github.com/getgrit/stdlib#*
- name: custom_no_console_log
level: warn
body: |
engine marzano(0.1)
language js
`console.log($msg)` => . where {
$filename <: is_not_excluded(),
$msg <: not within `if (DUMP_SECRETS) { $_ }`,
$msg <: not includes "listening on port",
$msg <: not includes "[KEEP]"
}
- name: no_tests_with_only
description: Forbid skipping tests with .only.
level: error
body: |
engine marzano(0.1)
language js
`$testlike.only` => `$testlike` where {
$testlike <: or {
`describe`,
`it`,
`test`
}
}
File renamed without changes.
2 changes: 0 additions & 2 deletions crates/cli/tests/apply.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1683,8 +1683,6 @@ fn applies_multifile_pattern_from_resolved_md() -> Result<()> {
.current_dir(&fixture_dir);

let output = cmd.output()?;
println!("Stdout is {:?}", String::from_utf8(output.stdout)?);
println!("Stderr is {:?}", String::from_utf8(output.stderr)?);
assert!(
output.status.success(),
"Command didn't finish successfully"
Expand Down
9 changes: 0 additions & 9 deletions crates/cli/tests/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,3 @@ fn does_not_attempt_to_check_universal_pattern() -> Result<()> {
assert!(output.contains("Fix available"));
Ok(())
}

#[test]
fn check_works_on_our_repo() -> Result<()> {
let dir = PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.canonicalize()?;
let output = check_cmd_output(dir, &[], None)?;
assert!(output.contains("Fix available"));
Ok(())
}
7 changes: 3 additions & 4 deletions crates/cli/tests/plumbing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,11 @@ fn compact_json_output() -> Result<()> {
fn returns_check_results_for_level() -> Result<()> {
let mut cmd = get_test_cmd()?;

let fixtures_root = get_fixtures_root()?;
let fixture_path = fixtures_root.join("check.ts");
let (_temp_dir, fixtures_root) = get_fixture("check_level", false)?;

let input = format!(r#"{{ "paths" : [{:?}] }}"#, fixture_path.to_str().unwrap());
let input = format!(r#"{{ "paths" : [{:?}] }}"#, "check.ts");

cmd.arg("plumbing").arg("check").arg("--level").arg("error");
cmd.arg("plumbing").arg("check").arg("--level").arg("error").current_dir(fixtures_root);
cmd.write_stdin(input);

let output = cmd.output()?;
Expand Down

0 comments on commit 6a6951b

Please sign in to comment.