-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathtests.js
54 lines (44 loc) · 1.41 KB
/
tests.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
var fs = require('fs');
var expect = require('chai').expect;
var libraw = require('./libraw');
describe('LibRAW', function() {
describe('Extracting thumbnail', function () {
var outputFilename = '';
it('should extract the thumbnail', function () {
libraw.extractThumb('./test.raf', './output')
.then(function(output) {
expect(output).to.equal('./output.thumb.jpg');
outputFilename = output;
});
});
it('should check that the file has been properly created', function(done) {
fs.access(outputFilename, fs.F_OK, function(err) {
expect(err).to.be.null;
done();
});
});
it('should delete the file after creation', function(done) {
fs.unlink(outputFilename, done);
});
});
describe('Extracting TIFF', function () {
var outputFilename = '';
it('should extract the tiff', function () {
this.timeout(90000);
libraw.extract('./test.raf', './output')
.then(function(output) {
expect(output).to.equal('./output.tiff');
outputFilename = output;
});
});
it('should check that the file has been properly created', function(done) {
fs.access(outputFilename, fs.F_OK, function(err) {
expect(err).to.be.null;
done();
});
});
it('should delete the file after creation', function(done) {
fs.unlink(outputFilename, done);
});
});
});