mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 19:07:49 +00:00
Cleanup perf/perf.js and test/test.js.
Former-commit-id: fba43c75aa25227e771a3cdd0cce0ee8ee9cdba6
This commit is contained in:
@@ -14,7 +14,9 @@
|
|||||||
);
|
);
|
||||||
|
|
||||||
var last = result[result.length - 1];
|
var last = result[result.length - 1];
|
||||||
result = (result.length > min && last != 'test.js') ? last : '../lodash.js';
|
result = (result.length > min && !/test(?:\.js)?$/.test(last))
|
||||||
|
? last
|
||||||
|
: '../lodash.js';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
result = require('fs').realpathSync(result);
|
result = require('fs').realpathSync(result);
|
||||||
@@ -55,10 +57,10 @@
|
|||||||
var suites = [];
|
var suites = [];
|
||||||
|
|
||||||
/** The `ui` object */
|
/** The `ui` object */
|
||||||
var ui = window.ui || {
|
var ui = window.ui || ({
|
||||||
'buildPath': basename(filePath, '.js'),
|
'buildPath': basename(filePath, '.js'),
|
||||||
'otherPath': 'underscore'
|
'otherPath': 'underscore'
|
||||||
};
|
});
|
||||||
|
|
||||||
/** The Lo-Dash build basename */
|
/** The Lo-Dash build basename */
|
||||||
var buildName = basename(ui.buildPath, '.js');
|
var buildName = basename(ui.buildPath, '.js');
|
||||||
|
|||||||
21
test/test.js
21
test/test.js
@@ -15,7 +15,9 @@
|
|||||||
);
|
);
|
||||||
|
|
||||||
var last = result[result.length - 1];
|
var last = result[result.length - 1];
|
||||||
result = (result.length > min && last != 'test.js') ? last : '../lodash.js';
|
result = (result.length > min && !/test(?:\.js)?$/.test(last))
|
||||||
|
? last
|
||||||
|
: '../lodash.js';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return require('fs').realpathSync(result);
|
return require('fs').realpathSync(result);
|
||||||
@@ -28,10 +30,11 @@
|
|||||||
var basename = /[\w.-]+$/.exec(filePath)[0];
|
var basename = /[\w.-]+$/.exec(filePath)[0];
|
||||||
|
|
||||||
/** The `platform` object to check */
|
/** The `platform` object to check */
|
||||||
var platform =
|
var platform = (
|
||||||
window.platform ||
|
window.platform ||
|
||||||
load('../vendor/platform.js/platform.js') ||
|
load('../vendor/platform.js/platform.js') ||
|
||||||
window.platform;
|
window.platform
|
||||||
|
);
|
||||||
|
|
||||||
/** The unit testing framework */
|
/** The unit testing framework */
|
||||||
var QUnit = (function() {
|
var QUnit = (function() {
|
||||||
@@ -47,12 +50,12 @@
|
|||||||
}());
|
}());
|
||||||
|
|
||||||
/** The `lodash` function to test */
|
/** The `lodash` function to test */
|
||||||
var _ = window._ || (
|
var _ =
|
||||||
_ = load(filePath) || window._,
|
window._ || (
|
||||||
_._ || _
|
_ = load(filePath) || window._,
|
||||||
);
|
_ = _._ || _,
|
||||||
|
_.runInContext(window)
|
||||||
_ = _.runInContext(window);
|
);
|
||||||
|
|
||||||
/** Used to pass falsey values to methods */
|
/** Used to pass falsey values to methods */
|
||||||
var falsey = [
|
var falsey = [
|
||||||
|
|||||||
Reference in New Issue
Block a user