Last active
March 6, 2020 21:48
-
-
Save nicksteffens/8a2503dec7ff531e19d8b90c43dcf99d to your computer and use it in GitHub Desktop.
Simple DOM query to use with Qunit results to find slow tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let slowTests = []; | |
| const testElements = document.querySelectorAll('li[id].pass'); | |
| const tolerance = 1500; | |
| testElements.forEach(test => { | |
| const moduleName = test.getElementsByClassName('module-name')[0].textContent | |
| const testName = test.getElementsByClassName('test-name')[0].textContent | |
| const testDurationString = test.getElementsByClassName('runtime')[0].textContent | |
| const testDuration = parseInt(testDurationString.slice(0, -3)) | |
| if (testDuration > tolerance) { | |
| slowTests.push(`- [ ] ${moduleName} ${testName} ${testDurationString}`) | |
| } | |
| }); | |
| console.log(slowTests.join('\n')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment