-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
34 lines (33 loc) · 959 Bytes
/
test.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
var assert = require('chai').assert;
var tjgl = require('./');
var simpleGit = require('simple-git');
var tmp = require('tmp');
var jsonfile = require('jsonfile');
var async = require('async');
describe('travis-json-git-log', function() {
it('lifecycle', function(done) {
tjgl.tjgl({
data: { time: new Date().valueOf() },
repo_slug: 'evolvator/travis-json-git-log',
filename: 'test'
}, (error, _context, config) => {
if (error) throw error;
var context = {};
async.series([
tjgl.prepareDir(context, config),
tjgl.clone(context, config),
tjgl.findFile(context, config),
(next) => {
jsonfile.readFile(context.filepath, function(error, json) {
assert.deepEqual(json, config.data);
next();
});
},
tjgl.clean(context, config),
], (error) => {
if (error) throw error;
done();
});
});
});
});