mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-28 16:20:52 +00:00
dca609e3f9
In preparation for the big extraction of Parsoid out of VisualEditor, we'll start by moving the tests into the parsoid location. Change-Id: I4a926ee4aad1490d4f769d44e91af80842b881f0
30 lines
672 B
JavaScript
30 lines
672 B
JavaScript
var fs = require('fs'),
|
|
path = require('path'),
|
|
https = require('https');
|
|
|
|
var url = {
|
|
host: 'gerrit.wikimedia.org',
|
|
path: '/r/gitweb?p=mediawiki/core.git;a=blob_plain;hb=HEAD;f=tests/parser/parserTests.txt',
|
|
};
|
|
var target_name = __dirname+"/parserTests.txt";
|
|
|
|
var fetch = function(url, target_name) {
|
|
https.get(url, function(result) {
|
|
var out = fs.createWriteStream(target_name);
|
|
result.on('data', function(data) {
|
|
out.write(data);
|
|
});
|
|
result.on('end', function() {
|
|
if (out)
|
|
out.end();
|
|
});
|
|
}).on('error', function(err) {
|
|
console.error(err);
|
|
});
|
|
};
|
|
path.exists(target_name, function(exists) {
|
|
if (!exists) {
|
|
fetch(url, target_name);
|
|
}
|
|
});
|