Try loading your script in the footer:
wp_enqueue_script( 'test', get_template_directory_uri() . '/js/testJS.js', array('jquery'), false, true );`
The true
parameter on the end tells WordPress to load this script in the footer instead of the header.
For more information, visit the Codex: https://developer.wordpress.org/reference/functions/wp_enqueue_script/