[Pkg-javascript-commits] [node-jade] 39/72: Rewrite output format test

Jelmer Vernooij jelmer at moszumanska.debian.org
Sun Jul 3 18:03:27 UTC 2016


This is an automated email from the git hooks/post-receive script.

jelmer pushed a commit to annotated tag upstream/1.0.0
in repository node-jade.

commit 13fe42f4c5712b1ae1e49be9a3af0366e9f9a0d9
Author: Timothy Gu <timothygu99 at gmail.com>
Date:   Tue Jul 7 17:23:06 2015 -0700

    Rewrite output format test
    
    This way it is symmetrical to the inputFormats test
---
 test/index.js         |  6 +-----
 test/output-format.js | 26 ++++++++++++++++++++++++++
 2 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/test/index.js b/test/index.js
index b724f43..8bfb4e3 100644
--- a/test/index.js
+++ b/test/index.js
@@ -14,11 +14,6 @@ test('constructor - throws if `tr` does not have a name', function () {
     createTransformer({});
   }, /Transformer must have a name/);
 });
-test('constructor - throws if `tr` does not have an output format', function () {
-  assert.throws(function () {
-    createTransformer({name: 'test'});
-  }, /Transformer must have an output format/);
-});
 test('constructor - throws if `tr` does not have any methods', function () {
   assert.throws(function () {
     createTransformer({name: 'test', outputFormat: 'html'});
@@ -39,3 +34,4 @@ require('./compile-file-client-async');
 require('./render');
 require('./render-async');
 require('./input-formats');
+require('./output-format');
diff --git a/test/output-format.js b/test/output-format.js
new file mode 100644
index 0000000..8dcbc9b
--- /dev/null
+++ b/test/output-format.js
@@ -0,0 +1,26 @@
+'use strict';
+
+var assert = require('assert');
+var test = require('./test');
+var createTransformer = require('../');
+
+test('outputFormat - preserves tr.outputFormat', function () {
+  var tr = createTransformer({
+    name: 'test',
+    outputFormat: 'css',
+    render: function (str, options) {
+      return str;
+    }
+  });
+  assert.equal(tr.outputFormat, 'css');
+});
+test('outputFormat - throws without tr.outputFormat', function () {
+  assert.throws(function () {
+    createTransformer({
+      name: 'test',
+      render: function (str, options) {
+        return str;
+      }
+    });
+  }, /Transformer must have an output format/);
+});

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-jade.git



More information about the Pkg-javascript-commits mailing list