Subramanya Sastry has uploaded a new change for review.
https://gerrit.wikimedia.org/r/50375
Change subject: Remove Jasmine tests and associated setup files.
......................................................................
Remove Jasmine tests and associated setup files.
* No longer used. These tests have long since been folded
into core parser tests.
Change-Id: I676df1e9fdcb76fb9c72ed6bdd344a06a4c29f94
---
D js/tests/package.json
D js/tests/parsoid.js
D js/tests/specs.js
D js/tests/specs/html2wt.spec.js
4 files changed, 0 insertions(+), 195 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Parsoid
refs/changes/75/50375/1
diff --git a/js/tests/package.json b/js/tests/package.json
deleted file mode 100644
index 09dd6c8..0000000
--- a/js/tests/package.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "name": "parsoid-tests",
- "description": "Jasmine test for Parsoid",
- "version": "0.0.1",
- "dependencies": {
- "domino": "~1.0.8",
- "jasmine-node": "~1.2.3",
- "should": "x.x.x"
- }
-}
diff --git a/js/tests/parsoid.js b/js/tests/parsoid.js
deleted file mode 100644
index a3b3b54..0000000
--- a/js/tests/parsoid.js
+++ /dev/null
@@ -1,53 +0,0 @@
-var domino = require('domino');
-
-// No instance properties
-function Parsoid() {}
-
-function initParsoid() {
- var path = require('path');
- var fileDependencies = [];
- var basePath = '..';
-
- function _require(filename) {
- var fullpath = path.join( basePath, filename );
- fileDependencies.push( fullpath );
- return require( fullpath );
- }
-
- function _import(filename, symbols) {
- var module = _require(filename);
- symbols.forEach(function(symbol) {
- global[symbol] = module[symbol];
- });
- }
-
- _import(path.join('lib', 'mediawiki.parser.environment.js'),
['MWParserEnvironment']);
- _import(path.join('lib', 'mediawiki.ParsoidConfig.js'),
['ParsoidConfig']);
- _import(path.join('lib', 'mediawiki.parser.js'),
['ParserPipelineFactory']);
- _import(path.join('lib', 'mediawiki.WikitextSerializer.js'),
['WikitextSerializer']);
-
- var options = {
- fetchTemplates: false,
- debug: false,
- trace: false
- };
- var parsoidConfig = new ParsoidConfig( null, options );
-
- MWParserEnvironment.getParserEnv( parsoidConfig, null, null, null,
function ( err, mwEnv ) {
- if ( err !== null ) {
- console.error( err.toString() );
- process.exit( 1 );
- }
- // "class" properties
- Parsoid.createDocument = function(html) {
- return domino.createDocument(html);
- };
- Parsoid.serializer = new WikitextSerializer({env: mwEnv});
- } );
-}
-
-initParsoid();
-
-if (typeof module === "object") {
- module.exports.Parsoid = Parsoid;
-}
diff --git a/js/tests/specs.js b/js/tests/specs.js
deleted file mode 100644
index d6c3255..0000000
--- a/js/tests/specs.js
+++ /dev/null
@@ -1,28 +0,0 @@
-// Code copied from
http://elegantcode.com/2011/03/07/taking-baby-steps-with-node-js-bdd-style-unit-tests-with-jasmine-node-sprinkled-with-some-should/
-// and suitably adapted for our purposes
-
-var jasmine = require('jasmine-node');
-
-Object.keys(jasmine).forEach(function ( key ) {
- global[key] = jasmine[key];
-});
-
-var isVerbose = true;
-var showColors = true;
-
-process.argv.slice(2).forEach(function(arg){
- switch(arg) {
- case '--color': showColors = true; break;
- case '--no-color': showColors = false; break;
- case '--no-verbose': isVerbose = false; break;
- }
-});
-
-jasmine.executeSpecsInFolder({
- specFolder:__dirname + '/specs',
- onComplete: function(runner, log) {
- process.exit(runner.results().failedCount);
- },
- isVerbose: isVerbose,
- showColors: showColors
-});
diff --git a/js/tests/specs/html2wt.spec.js b/js/tests/specs/html2wt.spec.js
deleted file mode 100644
index 29b28cb..0000000
--- a/js/tests/specs/html2wt.spec.js
+++ /dev/null
@@ -1,104 +0,0 @@
-var should = require('should'),
- parsoid = require('../parsoid').Parsoid;
-
-// Helpers
-function dom(snippet) {
- var document = parsoid.createDocument('<html><body>' + snippet +
'</body></html>');
- return document.body;
-}
-
-function wikitext(dom) {
- var out = [];
- parsoid.serializer.serializeDOM(dom, function(c) {
- out.push(c);
- });
- return out.join('');
-}
-
-function char_sequence(c, n) {
- var buf = [];
- for (var i = 0; i < n; i++) {
- buf.push(c);
- }
- return buf.join('');
-}
-
-// Heading specs
-describe("Headings", function() {
- // Regular non-empty specs
- it("should be serialized properly when non-empty", function() {
- // wikitext(dom("<h1>foo</h1>")).should.equal("=foo=");
- // Repeat pattern from h1 .. h6
- for (var i = 1; i <= 6; i++) {
- var str = char_sequence("=", i);
- var tag = "h" + i;
- var html = "<" + tag + ">foo</" + tag + ">";
- var res = str + "foo" + str;
- wikitext(dom(html)).should.equal(res);
- }
- });
-
- // Empty heading specs
- it("should be serialized properly when empty", function() {
- //
wikitext(dom("<h1></h1>")).should.equal("=<nowiki></nowiki>=");
- // Repeat pattern from h1 .. h6
- for (var i = 1; i <= 6; i++) {
- var str = char_sequence("=", i);
- var tag = "h" + i;
- var html = "<" + tag + "></" + tag + ">";
- var res = str + "<nowiki></nowiki>" + str;
- wikitext(dom(html)).should.equal(res);
- }
- });
-
- // Escape specs
- it("should escape wikitext properly", function() {
-
wikitext(dom("=foo=")).should.equal("<nowiki>=</nowiki>foo<nowiki>=</nowiki>");
-
- //
wikitext(dom("<h1>=foo=</h1>")).should.equal("=<nowiki>=</nowiki>foo<nowiki>=</nowiki>=");
- // Repeat pattern from h1 .. h5
- for (var i = 1; i <= 5; i++) {
- var str = char_sequence("=", i);
- var tag = "h" + i;
- var html = "<" + tag + ">=foo=</" + tag + ">";
- var res = str +
"<nowiki>=</nowiki>foo<nowiki>=</nowiki>" + str;
- wikitext(dom(html)).should.equal(res);
- }
- });
-
- it ("should escape wikitext after the closing tag if on the same line",
function() {
-
wikitext(dom("<h1>foo</h1>*bar")).should.equal("=foo=\n<nowiki>*</nowiki>bar");
- wikitext(dom("<h1>foo</h1>=bar")).should.equal("=foo=\n=bar");
-
wikitext(dom("<h1>foo</h1>=bar=")).should.equal("=foo=\n<nowiki>=</nowiki>bar<nowiki>=</nowiki>");
- });
-});
-
-// List specs
-describe("Lists", function() {
- // Escape specs
- it("should escape wikitext properly", function() {
- var liChars = ["*", "#", ":", ";"];
- for (var i = 0; i < liChars.length; i++) {
- var c = liChars[i];
- var html = "<ul><li>" + c + "foo</li></ul>";
- var res = "*<nowiki>" + c + "</nowiki>foo";
- wikitext(dom(html)).should.equal(res);
- }
-
- for (var i = 0; i < liChars.length; i++) {
- var c = liChars[i];
- var html = "<ol><li>" + c + "foo</li></ol>";
- var res = "#<nowiki>" + c + "</nowiki>foo";
- wikitext(dom(html)).should.equal(res);
- }
- });
-});
-
-// HR specs
-describe("<hr>", function() {
- it ("should escape wikitext after the closing tag if on the same line",
function() {
-
wikitext(dom("<hr/>----")).should.equal("----\n<nowiki>----</nowiki>");
-
wikitext(dom("<hr/>=foo=")).should.equal("----\n<nowiki>=</nowiki>foo<nowiki>=</nowiki>");
-
wikitext(dom("<hr/>*foo")).should.equal("----\n<nowiki>*</nowiki>foo");
- });
-});
--
To view, visit https://gerrit.wikimedia.org/r/50375
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I676df1e9fdcb76fb9c72ed6bdd344a06a4c29f94
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Parsoid
Gerrit-Branch: master
Gerrit-Owner: Subramanya Sastry <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits