You can use is_product()
WooCommerce conditional tag to identify if its single product page. Below is example code which enqueues test.js if its a single product page. You may use and tweak this code snippet further.
function mytheme_scripts() {
if ( is_product() ) {
wp_enqueue_script( 'test-js', get_template_directory_uri() . '/js/test.js', array() );
}
}
add_action( 'wp_enqueue_scripts', 'mytheme_scripts' );