You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
thumbsup/test/fixtures.js

34 lines
686 B
JavaScript

const Media = require('../src/model/media')
exports.file = function (opts) {
opts = opts || {}
return {
path: opts.path || 'path/image.jpg',
date: opts.date ? new Date(opts.date).getTime() : new Date().getTime(),
type: opts.type || 'image',
meta: {
SourceFile: 'path/image.jpg',
File: {},
EXIF: {},
IPTC: {},
XMP: {}
}
}
}
exports.date = function (str) {
return new Date(Date.parse(str))
}
exports.photo = function (opts) {
opts = opts || {}
opts.type = 'image'
return new Media(exports.file(opts))
}
exports.video = function (opts) {
opts = opts || {}
opts.type = 'video'
return new Media(exports.file(opts))
}