Tests adding a JavaScript file with a different weight.
function testDifferentWeight() {
$javascript = drupal_add_js('core/misc/collapse.js', array(
'weight' => 2,
));
$this
->assertEqual($javascript['core/misc/collapse.js']['weight'], 2, 'Adding a JavaScript file with a different weight caches the given weight.');
}