aboutsummaryrefslogtreecommitdiffstats
path: root/test/helper.js
blob: d5ac7a024c73beccb5b0d18fa46f9c7c1a41e9bd (plain) (blame)
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
var chai = require('chai'),
    fs = require('fs');

chai.Assertion.includeStack = true;
assert = chai.assert;

loadSample = function(file, cb) {
  var root = __dirname + '/../samples/';
  fs.readFile(root + file, 'utf8', function(err, contents) {
    cb(err, contents);
  });
};

defineSample = function(file, cb) {
  suiteSetup(function(done) {
    loadSample(file, function(err, data) {
      if (err) {
        done(err);
      }
      cb(data);
      done();
    });
  });
};

requireLib = function(lib) {
  return require(__dirname + '/../lib/webcals/' + lib);
};

Webcals = require('../lib/webcals/webcals.js');