From 72073c7fbf17b96eed90b8fb978ecc3bc46e45fe Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Thu, 25 Apr 2019 10:02:33 -0500 Subject: [PATCH] remove browser --- test/browser/index.html | 5 ---- test/browser/index.js | 39 ------------------------ test/browser/test.js | 66 ----------------------------------------- 3 files changed, 110 deletions(-) delete mode 100644 test/browser/index.html delete mode 100644 test/browser/index.js delete mode 100644 test/browser/test.js diff --git a/test/browser/index.html b/test/browser/index.html deleted file mode 100644 index fbde12931f..0000000000 --- a/test/browser/index.html +++ /dev/null @@ -1,5 +0,0 @@ - -marked tests -

testing...

- - diff --git a/test/browser/index.js b/test/browser/index.js deleted file mode 100644 index 8208fa3f1b..0000000000 --- a/test/browser/index.js +++ /dev/null @@ -1,39 +0,0 @@ -var fs = require('fs'), - path = require('path'); - -var testMod = require('../'), - load = testMod.load; - -var express = require('express'), - app = express(); - -var files = load(); - -app.use(function(req, res, next) { - var setHeader = res.setHeader; - res.setHeader = function(name) { - switch (name) { - case 'Cache-Control': - case 'Last-Modified': - case 'ETag': - return; - } - return setHeader.apply(res, arguments); - }; - next(); -}); - -app.get('/test.js', function(req, res, next) { - var test = fs.readFileSync(path.join(__dirname, 'test.js'), 'utf8'); - var testScript = test.replace('__TESTS__', JSON.stringify(files)) - .replace('__MAIN__', testMod.runTests + '') - .replace('__LIBS__', testMod.testFile + ''); - - res.contentType('.js'); - res.send(testScript); -}); - -app.use(express.static(path.join(__dirname, '/../../lib'))); -app.use(express.static(__dirname)); - -app.listen(8080); diff --git a/test/browser/test.js b/test/browser/test.js deleted file mode 100644 index 59917dd4ce..0000000000 --- a/test/browser/test.js +++ /dev/null @@ -1,66 +0,0 @@ - -;(function() { - var console = {}, - files = __TESTS__; // eslint-disable-line no-undef - - console.log = function(text) { - var args = Array.prototype.slice.call(arguments, 1), - i = 0; - - text = text.replace(/%\w/g, function() { - return args[i++] || ''; - }); - - if (window.console) window.console.log(text); - document.body.innerHTML += '
' + escape(text) + '
'; - }; - - if (!Object.keys) { - Object.keys = function(obj) { - var out = [], - key; - - for (key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - out.push(key); - } - } - - return out; - }; - } - - if (!Array.prototype.forEach) { - // eslint-disable-next-line no-extend-native - Array.prototype.forEach = function(callback, context) { - for (var i = 0; i < this.length; i++) { - callback.call(context || null, this[i], i, this); - } - }; - } - - if (!String.prototype.trim) { - // eslint-disable-next-line no-extend-native - String.prototype.trim = function() { - return this.replace(/^\s+|\s+$/g, ''); - }; - } - - // eslint-disable-next-line no-unused-vars - function load() { - return files; - } - - function escape(html, encode) { - return html - .replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&') - .replace(//g, '>') - .replace(/"/g, '"') - .replace(/'/g, '''); - } - - __LIBS__; // eslint-disable-line no-undef, no-unused-expressions - - (__MAIN__)(); // eslint-disable-line no-undef -}).call(this);