mirror of https://github.com/thumbsup/thumbsup
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.
28 lines
750 B
JavaScript
28 lines
750 B
JavaScript
7 years ago
|
const exiftool = require('../../../src/components/exiftool/parallel')
|
||
|
const path = require('path')
|
||
|
const readdir = require('readdir-enhanced')
|
||
|
const should = require('should/as-function')
|
||
|
|
||
|
// Find all test photos
|
||
|
const folder = path.join(__dirname, '..', '..', '..', 'fixtures')
|
||
|
const files = readdir.sync(folder, {
|
||
|
filter: stats => stats.isFile() && stats.path.charAt(0) !== '.',
|
||
|
deep: true
|
||
|
})
|
||
|
|
||
|
describe('exiftool', () => {
|
||
|
it('processes all files', (done) => {
|
||
|
const processed = []
|
||
|
const stream = exiftool.parse(folder, files)
|
||
|
stream.on('data', entry => {
|
||
|
processed.push(entry.SourceFile)
|
||
|
})
|
||
|
.on('end', () => {
|
||
|
files.sort()
|
||
|
processed.sort()
|
||
|
should(processed).eql(files)
|
||
|
done()
|
||
|
})
|
||
|
})
|
||
|
})
|