summaryrefslogtreecommitdiffstats
path: root/jest/customMatchers.js
blob: 4dd4f68e65a67eeef3ee94370bec0d4e02b905b7 (plain)
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
var path = require('path');
var fs = require('fs');

var matchers = {
    /**
        Verify that a file exists in a directory
    */
    toHaveFile: function () {
        return {
            compare: function (actual, expected) {
                var filePath = path.join(actual, expected);
                var exists = fs.existsSync(filePath);

                return {
                    pass: exists
                };
            }
        };
    }
};

jasmine.getEnv().beforeEach(function () {
    jasmine.DEFAULT_TIMEOUT_INTERVAL = 20000;
    jasmine.addMatchers(matchers);
});