Expand description
Which functions are tests, so that --compare measures tests and code
apart and pairs a test only with a test.
Most languages keep tests in files of their own, named by convention
(is_test_path): *_test.go, test_*.py, *.test.ts, *Test.java,
*Tests.swift, *_spec.rb, or folders such as tests/, __tests__/,
src/test/ and MyAppTests/. Two kinds of test live among the code
([inline_test]): Rust tests, in a #[cfg(test)] module or under a
#[test] attribute, and JavaScript and TypeScript test cases,
it('title', () => …), which Vitest runs from source files too.
Functions§
- is_
test_ path - Whether
pathnames a test file by the conventions of the languages jscpd compares.pathstarts at the compared folder itself (tests/copy.rswhen the folder istests/), so a folder given on the command line counts as well as the folders below it.