-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
56 lines (51 loc) · 1.2 KB
/
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
const { VCSGetter } = require('.');
const util = require("util");
const vcs = new VCSGetter({
git: {
gitCommand: 'git', // optional (default git)
localPathBase: "/tmp/git-vcs-test",
credentials: {
"https://***.visualstudio.com": "access-token", // required for private repositories
"https://###.visualstudio.com": "access-token"
}
},
tfs: {
tfCommand: "/opt/TEE-CLC-14.123.1/tf", // optional (default tf)
collections: [
{
url: "https://***.visualstudio.com",
user: "***",
passwd: "***",
workspace: {
name: "repo1-workspace-MACHINENAME",
localPathBase: "/tmp/tfs01"
}
},
{
url: 'http://tfs:8080/tfs',
user: '***',
passwd: '***',
workspace: {
name: "repo2-workspace-MACHINENAME",
localPathBase: "/tmp/tfs02"
}
}
]
}
});
const urls = [
'https://github.com/OleConsignado/vcs-getter/tree/master/README.md'
]
async function test() {
for(let url of urls) {
console.log(`++++++ Testing url: '${url}'`);
const result = await vcs.get(url);;
console.log(util.inspect(result));
console.log(`------ Done with '${url}'`);
}
}
test().catch(e => {
console.error(e);
process.exit(1);
});
module.export = { test };