From 4cccde482ea0a3f6bb7bfba6080ff3d6a92fc963 Mon Sep 17 00:00:00 2001 From: Patrick Steele-Idem Date: Tue, 7 Apr 2015 12:15:50 -0600 Subject: [PATCH] Removed unused test files --- test/dust-test.js | 56 ------------------------ test/taglib-test.js | 104 -------------------------------------------- 2 files changed, 160 deletions(-) delete mode 100644 test/dust-test.js delete mode 100644 test/taglib-test.js diff --git a/test/dust-test.js b/test/dust-test.js deleted file mode 100644 index d76e7c749..000000000 --- a/test/dust-test.js +++ /dev/null @@ -1,56 +0,0 @@ -'use strict'; -var chai = require('chai'); -chai.Assertion.includeStack = true; -require('chai').should(); -var expect = require('chai').expect; -var nodePath = require('path'); -var fs = require('fs'); - -var dust = require('dustjs-linkedin'); - -dust.onLoad = function(path, callback) { - if (!fs.existsSync(path)) { - if (!path.endsWith('.dust')) { - path += '.dust'; - } - } - - fs.readFile(path, 'utf-8', callback); -}; - -require('../dust').registerHelpers(dust); - - -xdescribe('marko-widgets/taglib' , function() { - - beforeEach(function(done) { - // for (var k in require.cache) { - // if (require.cache.hasOwnProperty(k)) { - // delete require.cache[k]; - // } - // } - - // require('raptor-logging').configureLoggers({ - // 'marko': 'INFO' - // }); - - done(); - }); - - it('should render a page with a single widget', function(done) { - require('./test-project/pages/dust').render(function(err, output) { - if (err) { - return done(err); - } - - try { - console.log('output: ', output); - done(); - } catch(e) { - done(e); - } - }); - }); - -}); - diff --git a/test/taglib-test.js b/test/taglib-test.js deleted file mode 100644 index 6f5fead6b..000000000 --- a/test/taglib-test.js +++ /dev/null @@ -1,104 +0,0 @@ -'use strict'; -var chai = require('chai'); -chai.Assertion.includeStack = true; -require('chai').should(); -var expect = require('chai').expect; -var nodePath = require('path'); -var fs = require('fs'); - -var StringBuilder = require('raptor-strings/StringBuilder'); - -function testCompiler(path) { - var inputPath = nodePath.join(__dirname, path); - var expectedPath = nodePath.join(__dirname, path + '.expected.js'); - var actualPath = nodePath.join(__dirname, path + '.actual.js'); - - var compiler = require('marko/compiler').createCompiler(inputPath); - var src = fs.readFileSync(inputPath, {encoding: 'utf8'}); - - var output = compiler.compile(src); - fs.writeFileSync(actualPath, output, {encoding: 'utf8'}); - - var expected; - try { - expected = fs.readFileSync(expectedPath, {encoding: 'utf8'}); - } - catch(e) { - expected = 'TBD'; - fs.writeFileSync(expectedPath, expected, {encoding: 'utf8'}); - } - - if (output !== expected) { - throw new Error('Unexpected output for "' + inputPath + '":\nEXPECTED (' + expectedPath + '):\n---------\n' + expected + - '\n---------\nACTUAL (' + actualPath + '):\n---------\n' + output + '\n---------'); - } -} - -function testRender(path, data, done, options) { - var inputPath = nodePath.join(__dirname, path); - var expectedPath = nodePath.join(__dirname, path + '.expected.html'); - var actualPath = nodePath.join(__dirname, path + '.actual.html'); - options = options || {}; - // var compiledPath = nodePath.join(__dirname, path + '.actual.js'); - // var compiler = require('marko/compiler').createCompiler(inputPath); - // var src = fs.readFileSync(inputPath, {encoding: 'utf8'}); - - // var compiledSrc = compiler.compile(src); - // fs.writeFileSync(compiledPath, compiledSrc, {encoding: 'utf8'}); - - var marko = require('marko'); - var Context = marko.Context; - var context = options.context || new Context(new StringBuilder()); - - marko.render(inputPath, data, context) - .on('finish', function() { - var output = context.getOutput(); - - fs.writeFileSync(actualPath, output, {encoding: 'utf8'}); - - var expected; - try { - expected = options.expected || fs.readFileSync(expectedPath, {encoding: 'utf8'}); - } - catch(e) { - expected = 'TBD'; - fs.writeFileSync(expectedPath, expected, {encoding: 'utf8'}); - } - - if (output !== expected) { - throw new Error('Unexpected output for "' + inputPath + '":\nEXPECTED (' + expectedPath + '):\n---------\n' + expected + - '\n---------\nACTUAL (' + actualPath + '):\n---------\n' + output + '\n---------'); - } - - done(); - }) - .on('error', done) - .end(); -} - -xdescribe('marko-widgets/taglib' , function() { - - beforeEach(function(done) { - // for (var k in require.cache) { - // if (require.cache.hasOwnProperty(k)) { - // delete require.cache[k]; - // } - // } - - // require('raptor-logging').configureLoggers({ - // 'marko': 'INFO' - // }); - - done(); - }); - - it('should compile a simple template with a w:widget attribute', function() { - testCompiler('test-project/foo/view.marko'); - }); - - it('should render a simple page', function(done) { - testRender('test-project/page1.marko', {}, done); - }); - -}); -