Skip to content

Commit cf9182c

Browse files
authored
Merge pull request #16 from vizzuhq/veghdev
manual: reload test cases list on requests
2 parents d7756ff + 3729e90 commit cf9182c

File tree

2 files changed

+20
-611
lines changed

2 files changed

+20
-611
lines changed

test/integration/manual/manual.js

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,30 +26,37 @@ class Manual {
2626

2727
this.#server.use(express.static(this.#rootPath));
2828

29-
this.#getLibList()
30-
this.#getTestList()
29+
this.#getLibList();
30+
this.#getTestList();
3131

3232
this.#server.listen(this.#port);
3333
console.log('[ HOSTING ]' + ' ' + '[ ' + 'http://127.0.0.1:' + this.#port + '/test/integration/manual' + ' ]' + ' press CTRL + C to stop');
3434
}
3535

36-
async #getLibList() {
37-
let libList = { localhost: 'http://127.0.0.1:' + this.#port + '/example/lib' };
38-
libList['HEAD'] = 'https://' + remoteStableBucket + '/lib';
39-
let vizzuListUrl = await fetch('https://' + remoteCloudFunctions + '/getVizzuList');
40-
let vizzuList = await vizzuListUrl.json();
41-
vizzuList.slice().reverse().forEach(vizzu => {
42-
libList[vizzu.time.substring(0,10) + ' ' + vizzu.time.substring(11,16) + ' ' + vizzu.sha] = 'https://' + remoteLatestBucket + '/' + vizzu.sha;
43-
});
44-
libList['0.2.0'] = 'https://vizzuhq.github.io/vizzu-beta-release/0.2.0';
36+
#getLibList() {
4537
this.#server.get('/getLibList', (req, res) => {
46-
res.send(libList);
38+
let libList = { localhost: 'http://127.0.0.1:' + this.#port + '/example/lib' };
39+
libList['HEAD'] = 'https://' + remoteStableBucket + '/lib';
40+
fetch('https://' + remoteCloudFunctions + '/getVizzuList').then(vizzuListUrl => {
41+
vizzuListUrl.json().then(vizzuList => {
42+
vizzuList.slice().reverse().forEach(vizzu => {
43+
libList[vizzu.time.substring(0,10) + ' ' + vizzu.time.substring(11,16) + ' ' + vizzu.sha] = 'https://' + remoteLatestBucket + '/' + vizzu.sha;
44+
});
45+
//libList['0.3.1'] = 'https://cdn.jsdelivr.net/npm/[email protected]/dist';
46+
//libList['0.3.0'] = 'https://cdn.jsdelivr.net/npm/[email protected]/dist';
47+
libList['0.2.0'] = 'https://vizzuhq.github.io/vizzu-beta-release/0.2.0';
48+
res.send(libList);
49+
}).catch((err) => {
50+
console.log(err)
51+
});
52+
});
4753
});
4854
}
4955

5056
#getTestList() {
51-
this.#setTestList(this.#testPath);
5257
this.#server.get('/getTestList', (req, res) => {
58+
this.#testList = [];
59+
this.#setTestList(this.#testPath);
5360
res.send(this.#testList);
5461
});
5562
}

0 commit comments

Comments
 (0)