This repository has been archived by the owner on Jul 9, 2023. It is now read-only.
forked from bestiejs/benchmark.js
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replace lodash with cdn lodash add chai for assert substiture for browser tests make use of mocha and chai in index.html
- Loading branch information
Showing
8 changed files
with
39 additions
and
169 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,11 @@ | |
"homepage": "https://benchmarkjs.com/", | ||
"license": "MIT", | ||
"main": "benchmark.js", | ||
"keywords": ["benchmark", "performance", "speed"], | ||
"keywords": [ | ||
"benchmark", | ||
"performance", | ||
"speed" | ||
], | ||
"author": "Mathias Bynens <[email protected]>", | ||
"types": "types/index.d.ts", | ||
"contributors": [ | ||
|
@@ -24,11 +28,8 @@ | |
"test:coverage": "nyc npm run test", | ||
"test:tsd": "tsd" | ||
}, | ||
"dependencies": { | ||
"lodash": "^4.17.10", | ||
"platform": "^1.3.6" | ||
}, | ||
"devDependencies": { | ||
"chai": "^4.3.6", | ||
"coveralls": "^3.1.1", | ||
"docdown": "^0.7.3", | ||
"mocha": "^9.2.1", | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,27 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Benchmark.js Test Suite</title> | ||
<link rel="stylesheet" href="../node_modules/qunitjs/qunit/qunit.css"> | ||
</head> | ||
<body> | ||
<div id="qunit"></div> | ||
<script src="../node_modules/qunitjs/qunit/qunit.js"></script> | ||
<script src="../node_modules/qunit-extras/qunit-extras.js"></script> | ||
<script src="../node_modules/lodash/lodash.js"></script> | ||
<script src="../node_modules/platform/platform.js"></script> | ||
<script> | ||
QUnit.config.hidepassed = true; | ||
QUnit.urlParams.norequire = /[?&]norequire=true(?:&|$)/.test(location.search); | ||
|
||
// Load test.js if not using require.js. | ||
document.write(QUnit.urlParams.norequire | ||
? '<script src="../benchmark.js"><\/script><script src="test.js"><\/script>' | ||
: '<script src="../node_modules/requirejs/require.js"><\/script>' | ||
); | ||
</script> | ||
<script> | ||
var benchmarkModule; | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Benchmark.js Test Suite</title> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/mocha/9.2.2/mocha.css"> | ||
</head> | ||
|
||
(function() { | ||
if (!window.require) { | ||
return; | ||
} | ||
QUnit.config.autostart = false; | ||
<body> | ||
<div id="mocha" /> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mocha/8.0.1/mocha.min.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/chai/4.3.6/chai.min.js"></script> | ||
<script src="../benchmark.js"></script> | ||
|
||
requirejs.config({ | ||
'baseUrl': './', | ||
'urlArgs': 't=' + (+new Date), | ||
'waitSeconds': 0, | ||
'packages': [ | ||
{ | ||
'name': 'benchmark', | ||
'location': '..', | ||
'main': 'benchmark' | ||
}, | ||
{ | ||
'name': 'lodash', | ||
'location': '../node_modules/lodash', | ||
'main': 'lodash' | ||
}, | ||
{ | ||
'name': 'platform', | ||
'location': '../node_modules/platform', | ||
'main': 'platform' | ||
}, | ||
{ | ||
'name': 'test', | ||
'location': '.', | ||
'main': 'test' | ||
} | ||
] | ||
}); | ||
<script> | ||
mocha.setup('bdd'); | ||
mocha.timeout(60000); | ||
</script> | ||
<script src="../test/test.js"></script> | ||
|
||
// Load Benchmark as a module. | ||
require(['benchmark'], function(Benchmark) { | ||
benchmarkModule = window.Benchmark = Benchmark; | ||
require(['test'], function() { | ||
QUnit.start(); | ||
}); | ||
}); | ||
}()); | ||
<script> | ||
mocha.run(); | ||
</script> | ||
</body> | ||
|
||
// Set a more readable browser name. | ||
window.onload = function() { | ||
var timeoutId = setInterval(function() { | ||
var ua = document.getElementById('qunit-userAgent'); | ||
if (ua && (benchmarkModule || !window.require)) { | ||
ua.innerHTML = platform; | ||
clearInterval(timeoutId); | ||
} | ||
}, 16); | ||
}; | ||
</script> | ||
</body> | ||
</html> | ||
</html> |
This file contains 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
This file contains 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