@@ -42,6 +42,7 @@ def test_plugin_initialization(self):
4242 assert plugin .clean_after is False
4343 assert plugin .skip_build_if_recent is True
4444 assert plugin .skip_build_time_threshold == 5
45+ assert plugin .skip_build is False
4546
4647 def test_plugin_initialization_with_custom_parameters (self ):
4748 """Test plugin initialization with custom parameters."""
@@ -59,6 +60,7 @@ def test_plugin_initialization_with_custom_parameters(self):
5960 download_node = True ,
6061 node_version = '20.0.0' ,
6162 clean_after = True ,
63+ skip_build = True ,
6264 skip_build_if_recent = False ,
6365 skip_build_time_threshold = 10 ,
6466 )
@@ -72,6 +74,7 @@ def test_plugin_initialization_with_custom_parameters(self):
7274 assert plugin .download_node is True
7375 assert plugin .node_version == '20.0.0'
7476 assert plugin .clean_after is True
77+ assert plugin .skip_build is True
7578 assert plugin .skip_build_if_recent is False
7679 assert plugin .skip_build_time_threshold == 10
7780
@@ -399,6 +402,25 @@ def test_extract_assets_tags_no_file(self):
399402 # Should return empty string
400403 assert tags == ''
401404
405+ def test_skip_build_param (self ):
406+ """Test the skip build logic when skip_build param is True."""
407+ build_assets_paths = ['assets/js' ]
408+ entry_js_paths = ['assets/js/main.js' ]
409+ npm_packages = [NpmPackage ('react' )]
410+
411+ plugin = VitePlugin (
412+ build_assets_paths = build_assets_paths ,
413+ entry_js_paths = entry_js_paths ,
414+ npm_packages = npm_packages ,
415+ skip_build = True ,
416+ )
417+
418+ # Check the skip logic directly
419+ should_skip = plugin ._should_skip_build ()
420+
421+ # Should be True
422+ assert should_skip is True
423+
402424 def test_skip_build_logic_recent_file (self ):
403425 """Test the skip build logic when file is recent."""
404426 build_assets_paths = ['assets/js' ]
0 commit comments