Files
spota-dev/assets/plugins/moment/test/moment/is_moment.js
Power BI Dev a52c2a8462 Add frontend assets and plugin bundles
Add the legacy frontend themes, scripts, and plugin assets required by the main SPOTA interfaces.
2026-05-02 10:09:32 +07:00

28 lines
1.1 KiB
JavaScript

var moment = require('../../moment');
exports.is_moment = {
"is moment object": function (test) {
test.expect(11);
var MyObj = function () {};
MyObj.prototype.toDate = function () {
return new Date();
};
test.ok(moment.isMoment(moment()), 'simple moment object');
test.ok(moment.isMoment(moment('invalid date')), 'invalid moment object');
test.ok(!moment.isMoment(new MyObj()), 'myObj is not moment object');
test.ok(!moment.isMoment(moment), 'moment function is not moment object');
test.ok(!moment.isMoment(new Date()), 'date object is not moment object');
test.ok(!moment.isMoment(Object), 'Object is not moment object');
test.ok(!moment.isMoment('foo'), 'string is not moment object');
test.ok(!moment.isMoment(1), 'number is not moment object');
test.ok(!moment.isMoment(NaN), 'NaN is not moment object');
test.ok(!moment.isMoment(null), 'null is not moment object');
test.ok(!moment.isMoment(undefined), 'undefined is not moment object');
test.done();
}
};