test: standardized jest unit testing (#10047)

This commit is contained in:
Nathan Walker
2022-11-28 14:30:32 -08:00
parent 66e8e39f1e
commit b147612e06
103 changed files with 1354 additions and 12804 deletions

View File

@ -114,18 +114,18 @@ function transformAst(node, css, type) {
if (node.type === 'Raw') {
return null;
}
throw Error("Unknown node type " + node.type);
throw Error("Unknown node type ".concat(node.type));
}
function cssTreeParse(css, source) {
var errors = [];
var ast = css_tree_1.parse(css, {
var ast = (0, css_tree_1.parse)(css, {
parseValue: false,
parseAtrulePrelude: false,
parseRulePrelude: false,
positions: true,
filename: source,
onParseError: function (error) {
errors.push(source + ":" + error.line + ":" + error.column + ": " + error.formattedMessage);
errors.push("".concat(source, ":").concat(error.line, ":").concat(error.column, ": ").concat(error.formattedMessage));
},
});
if (errors.length > 0) {