Skip to content

Commit

Permalink
chore(misc): fix failing remove unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
FrozenPandaz committed May 14, 2024
1 parent 6c36bef commit 56769b1
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ use crate::native::project_graph::types::ProjectGraph;
pub fn transfer_project_graph(project_graph: ProjectGraph) -> External<ProjectGraph> {
External::new(project_graph)
}

19 changes: 17 additions & 2 deletions packages/nx/src/native/pseudo_terminal/mac.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,15 @@ impl RustPseudoTerminal {
tty: Option<bool>,
) -> napi::Result<ChildProcess> {
let pseudo_terminal = create_pseudo_terminal()?;
run_command(&pseudo_terminal, command, command_dir, js_env, exec_argv, quiet, tty)
run_command(
&pseudo_terminal,
command,
command_dir,
js_env,
exec_argv,
quiet,
tty,
)
}

/// This allows us to run a pseudoterminal with a fake node ipc channel
Expand All @@ -53,6 +61,13 @@ impl RustPseudoTerminal {
);

trace!("nx_fork command: {}", &command);
self.run_command(command, command_dir, js_env, exec_argv, Some(quiet), Some(true))
self.run_command(
command,
command_dir,
js_env,
exec_argv,
Some(quiet),
Some(true),
)
}
}
9 changes: 8 additions & 1 deletion packages/nx/src/native/pseudo_terminal/non_mac.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ impl RustPseudoTerminal {
);

trace!("nx_fork command: {}", &command);
self.run_command(command, command_dir, js_env, exec_argv, Some(quiet), Some(true))
self.run_command(
command,
command_dir,
js_env,
exec_argv,
Some(quiet),
Some(true),
)
}
}
4 changes: 2 additions & 2 deletions packages/nx/src/native/tasks/hashers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ mod hash_project_config;
mod hash_project_files;
mod hash_runtime;
mod hash_task_output;
mod hash_workspace_files;
mod hash_tsconfig;
mod hash_workspace_files;

pub use hash_env::*;
pub use hash_external::*;
pub use hash_project_config::*;
pub use hash_project_files::*;
pub use hash_runtime::*;
pub use hash_task_output::*;
pub use hash_tsconfig::*;
pub use hash_workspace_files::*;
pub use hash_tsconfig::*;
12 changes: 4 additions & 8 deletions packages/nx/src/native/utils/path.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::native::{utils::normalize_trait::Normalize, types::FileData};
use crate::native::{types::FileData, utils::normalize_trait::Normalize};
use std::path::{Path, PathBuf};

impl Normalize for Path {
Expand Down Expand Up @@ -65,13 +65,9 @@ mod test {
FileData {
file: "foo-other/not-child".into(),
hash: "123".into(),
}
},
];
let child_files = get_child_files(&directory, files);
assert_eq!(child_files, [
"foo/bar",
"foo/baz",
"foo/child/bar",
]);
assert_eq!(child_files, ["foo/bar", "foo/baz", "foo/child/bar",]);
}
}
}
2 changes: 0 additions & 2 deletions packages/nx/src/native/watch/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,6 @@ pub fn transform_event_to_watch_events(
}
}
}


}

fn create_watch_event_internal(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ describe('updateTsconfig', () => {
forceRemove: false,
importPath: '@proj/whatever-name',
};

graph = {
nodes: {},
dependencies: {},
};
});

it('should delete project ref from the root tsconfig.base.json', async () => {
Expand Down

0 comments on commit 56769b1

Please sign in to comment.