Home / Function/ test_allow_explicit_node_modules_paths() — tailwindcss Function Reference

test_allow_explicit_node_modules_paths() — tailwindcss Function Reference

Architecture documentation for the test_allow_explicit_node_modules_paths() function in scanner.rs from the tailwindcss codebase.

Entity Profile

Dependency Diagram

graph TD
  0681881e_41d5_6fe7_96bf_7226236f4e9d["test_allow_explicit_node_modules_paths()"]
  6b48c515_a72f_7a7d_7ea7_b80f71a82b19["scanner.rs"]
  0681881e_41d5_6fe7_96bf_7226236f4e9d -->|defined in| 6b48c515_a72f_7a7d_7ea7_b80f71a82b19
  56624ac4_6945_32d1_2b96_700de264829d["create_files_in()"]
  0681881e_41d5_6fe7_96bf_7226236f4e9d -->|calls| 56624ac4_6945_32d1_2b96_700de264829d
  0ffee7bc_8829_8e8e_00ee_4a8f4e4d9736["public_source_entry_from_pattern()"]
  0681881e_41d5_6fe7_96bf_7226236f4e9d -->|calls| 0ffee7bc_8829_8e8e_00ee_4a8f4e4d9736
  89cd8369_536c_74e5_91d1_719df04e4597["scan()"]
  0681881e_41d5_6fe7_96bf_7226236f4e9d -->|calls| 89cd8369_536c_74e5_91d1_719df04e4597
  style 0681881e_41d5_6fe7_96bf_7226236f4e9d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

crates/oxide/tests/scanner.rs lines 1416–1475

    fn test_allow_explicit_node_modules_paths() {
        // Create a temporary working directory
        let dir = tempdir().unwrap().into_path();

        // Create files
        create_files_in(
            &dir,
            &[
                // Current project
                ("src/index.html", "content-['src/index.html']"),
                // Ignore file
                (".gitignore", "node_modules"),
                // Library ignored by default
                (
                    "node_modules/my-ui-lib/index.html",
                    "content-['node_modules/my-ui-lib/index.html']",
                ),
            ],
        );

        // Default auto source detection
        let sources = vec![public_source_entry_from_pattern(
            dir.clone(),
            "@source './'",
        )];

        let mut scanner = Scanner::new(sources.clone());

        let candidates = scanner.scan();
        assert_eq!(candidates, vec!["content-['src/index.html']"]);

        // Explicitly listing all `*.html` files, should not include `node_modules` because it's
        // ignored
        let sources = vec![public_source_entry_from_pattern(
            dir.clone(),
            "@source '**/*.html'",
        )];

        let mut scanner = Scanner::new(sources.clone());
        let candidates = scanner.scan();
        assert_eq!(candidates, vec!["content-['src/index.html']"]);

        // Explicitly listing all `*.html` files
        // Explicitly list the `node_modules/my-ui-lib`
        //
        let sources = vec![
            public_source_entry_from_pattern(dir.clone(), "@source '**/*.html'"),
            public_source_entry_from_pattern(dir.clone(), "@source 'node_modules/my-ui-lib'"),
        ];

        let mut scanner = Scanner::new(sources.clone());
        let candidates = scanner.scan();
        assert_eq!(
            candidates,
            vec![
                "content-['node_modules/my-ui-lib/index.html']",
                "content-['src/index.html']"
            ]
        );
    }

Domain

Subdomains

Frequently Asked Questions

What does test_allow_explicit_node_modules_paths() do?
test_allow_explicit_node_modules_paths() is a function in the tailwindcss codebase, defined in crates/oxide/tests/scanner.rs.
Where is test_allow_explicit_node_modules_paths() defined?
test_allow_explicit_node_modules_paths() is defined in crates/oxide/tests/scanner.rs at line 1416.
What does test_allow_explicit_node_modules_paths() call?
test_allow_explicit_node_modules_paths() calls 3 function(s): create_files_in, public_source_entry_from_pattern, scan.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free