Added a function from scripts.js to tests