Skip to content

Commit

Permalink
Updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
deamme committed Jan 24, 2018
1 parent 8375fa0 commit 48025de
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 82 deletions.
2 changes: 1 addition & 1 deletion tests/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function compile(path: string, callback) {
const program = ts.createProgram(files, config, compilerHost);

program.emit(undefined, compare, undefined, undefined, {
before: [transform({ classwrap: true })]
before: [transform()]
});

callback(files);
Expand Down
28 changes: 1 addition & 27 deletions tests/references/divWithChildAndClassExpression.jsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,3 @@
var __classwrap = function(classes, prefix) {
var value
var className = ""
var type = typeof classes
if ((classes && type === "string") || type === "number") {
return classes
}
prefix = prefix || " "
if (Array.isArray(classes) && classes.length) {
for (var i = 0, l = classes.length; i < l; i++) {
if ((value = __classwrap(classes[i], prefix))) {
className += (className && prefix) + value
}
}
} else {
for (var i in classes) {
if (classes.hasOwnProperty(i) && (value = classes[i])) {
className +=
(className && prefix) +
i +
(typeof value === "object" ? __classwrap(value, prefix + i) : "")
}
}
}
return className
}
var Inferno = require("inferno");
var createVNode = Inferno.createVNode;
createVNode(2, "div", __classwrap("first" + "second"), "1");
createVNode(2, "div", "first" + "second", "1");
28 changes: 1 addition & 27 deletions tests/references/divWithClassAsVariable.jsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,3 @@
var __classwrap = function(classes, prefix) {
var value
var className = ""
var type = typeof classes
if ((classes && type === "string") || type === "number") {
return classes
}
prefix = prefix || " "
if (Array.isArray(classes) && classes.length) {
for (var i = 0, l = classes.length; i < l; i++) {
if ((value = __classwrap(classes[i], prefix))) {
className += (className && prefix) + value
}
}
} else {
for (var i in classes) {
if (classes.hasOwnProperty(i) && (value = classes[i])) {
className +=
(className && prefix) +
i +
(typeof value === "object" ? __classwrap(value, prefix + i) : "")
}
}
}
return className
}
var Inferno = require("inferno");
var createVNode = Inferno.createVNode;
createVNode(2, "div", __classwrap(variable), "1");
createVNode(2, "div", variable, "1");
28 changes: 1 addition & 27 deletions tests/references/divWithEvents.jsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,3 @@
var __classwrap = function(classes, prefix) {
var value
var className = ""
var type = typeof classes
if ((classes && type === "string") || type === "number") {
return classes
}
prefix = prefix || " "
if (Array.isArray(classes) && classes.length) {
for (var i = 0, l = classes.length; i < l; i++) {
if ((value = __classwrap(classes[i], prefix))) {
className += (className && prefix) + value
}
}
} else {
for (var i in classes) {
if (classes.hasOwnProperty(i) && (value = classes[i])) {
className +=
(className && prefix) +
i +
(typeof value === "object" ? __classwrap(value, prefix + i) : "")
}
}
}
return className
}
var Inferno = require("inferno");
var createVNode = Inferno.createVNode;
createVNode(2, "div", __classwrap(variable), "1", { "id": "test", "onClick": func });
createVNode(2, "div", variable, "1", { "id": "test", "onClick": func });

0 comments on commit 48025de

Please sign in to comment.