2
0
mirror of https://github.com/thumbsup/thumbsup synced 2024-11-17 15:25:50 +00:00
thumbsup/test/fixtures.js
2016-10-13 18:49:15 +11:00

46 lines
874 B
JavaScript

var File = require('../src/file');
exports.metadata = function() {
return {
fileDate: new Date(),
mediaType: 'photo',
exif: {
date: null,
orientation: 1,
caption: ''
}
};
};
exports.date = function(str) {
return new Date(Date.parse(str));
};
exports.photo = function(opts) {
opts = opts || {};
var date = opts.date ? new Date(Date.parse(opts.date)) : new Date();
return new File(opts.path || 'tmp', {
fileDate: date,
mediaType: 'photo',
exif: {
date: null,
orientation: 1,
caption: ''
}
});
};
exports.video = function(opts) {
opts = opts || {};
var date = opts.date ? new Date(Date.parse(opts.date)) : new Date();
return new File(opts.path || 'tmp', {
fileDate: date,
mediaType: 'video',
exif: {
date: null,
orientation: 1,
caption: ''
}
});
};