Sha256: 3eeafdf22de9787953e049b4f70cf8674fa088ea24211e8000b6a11d6aadd1a8

Contents?: true

Size: 1.96 KB

Versions: 72

Compression:

Stored size: 1.96 KB

Contents

"use strict";

var _helpers = require("./util/helpers");

(0, _helpers.test)('comments', '/*test comment*/h2', function (t, tree) {
  t.deepEqual(tree.nodes[0].nodes[0].value, '/*test comment*/');
  t.deepEqual(tree.nodes[0].nodes[1].value, 'h2');
});
(0, _helpers.test)('comments (2)', '.a  /*test comment*/label', function (t, tree) {
  t.deepEqual(tree.nodes[0].nodes[0].type, 'class');
  t.deepEqual(tree.nodes[0].nodes[1].type, 'combinator');
  t.deepEqual(tree.nodes[0].nodes[1].value, ' ');
  t.deepEqual(tree.nodes[0].nodes[1].spaces.after, ' ');
  t.deepEqual(tree.nodes[0].nodes[1].rawSpaceAfter, ' /*test comment*/');
  t.deepEqual(tree.nodes[0].nodes[2].type, 'tag');
});
(0, _helpers.test)('comments (3)', '.a  /*test comment*/  label', function (t, tree) {
  t.deepEqual(tree.nodes[0].nodes[0].type, 'class');
  t.deepEqual(tree.nodes[0].nodes[1].type, 'combinator');
  t.deepEqual(tree.nodes[0].nodes[1].value, ' ');
  t.deepEqual(tree.nodes[0].nodes[1].spaces.before, '   ');
  t.deepEqual(tree.nodes[0].nodes[1].rawSpaceBefore, '  /*test comment*/ ');
  t.deepEqual(tree.nodes[0].nodes[2].type, 'tag');
});
(0, _helpers.test)('multiple comments and other things', 'h1/*test*/h2/*test*/.test/*test*/', function (t, tree) {
  t.deepEqual(tree.nodes[0].nodes[0].type, 'tag', 'should have a tag');
  t.deepEqual(tree.nodes[0].nodes[1].type, 'comment', 'should have a comment');
  t.deepEqual(tree.nodes[0].nodes[2].type, 'tag', 'should have a tag');
  t.deepEqual(tree.nodes[0].nodes[3].type, 'comment', 'should have a comment');
  t.deepEqual(tree.nodes[0].nodes[4].type, 'class', 'should have a class name');
  t.deepEqual(tree.nodes[0].nodes[5].type, 'comment', 'should have a comment');
});
(0, _helpers.test)('ending in comment', ".bar /* comment 3 */", function (t, tree) {
  var classname = tree.nodes[0].nodes[0];
  t.deepEqual(classname.type, 'class', 'should have a tag');
  t.deepEqual(classname.spaces.after, ' ');
  t.deepEqual(classname.raws.spaces.after, ' /* comment 3 */');
});

Version data entries

72 entries across 47 versions & 8 rubygems

Version Path
tang-0.2.0 spec/tang_app/node_modules/postcss-modules-scope/node_modules/postcss-selector-parser/dist/__tests__/comments.js
tang-0.2.0 spec/tang_app/node_modules/postcss-attribute-case-insensitive/node_modules/postcss-selector-parser/dist/__tests__/comments.js
tang-0.2.0 spec/tang_app/node_modules/postcss-calc/node_modules/postcss-selector-parser/dist/__tests__/comments.js
tang-0.2.0 spec/tang_app/node_modules/postcss-modules-local-by-default/node_modules/postcss-selector-parser/dist/__tests__/comments.js
trusty-cms-4.1.7 node_modules/postcss-selector-parser/dist/__tests__/comments.js
boring_generators-0.4.0 tmp/templates/app_template/node_modules/postcss-selector-parser/dist/__tests__/comments.js
tang-0.1.0 spec/tang_app/node_modules/postcss-modules-scope/node_modules/postcss-selector-parser/dist/__tests__/comments.js
tang-0.1.0 spec/tang_app/node_modules/postcss-modules-local-by-default/node_modules/postcss-selector-parser/dist/__tests__/comments.js
tang-0.1.0 spec/tang_app/node_modules/postcss-attribute-case-insensitive/node_modules/postcss-selector-parser/dist/__tests__/comments.js
tang-0.1.0 spec/tang_app/node_modules/postcss-calc/node_modules/postcss-selector-parser/dist/__tests__/comments.js
tang-0.0.9 spec/tang_app/node_modules/postcss-modules-scope/node_modules/postcss-selector-parser/dist/__tests__/comments.js
tang-0.0.9 spec/tang_app/node_modules/postcss-calc/node_modules/postcss-selector-parser/dist/__tests__/comments.js
tang-0.0.9 spec/tang_app/node_modules/postcss-attribute-case-insensitive/node_modules/postcss-selector-parser/dist/__tests__/comments.js
tang-0.0.9 spec/tang_app/node_modules/postcss-modules-local-by-default/node_modules/postcss-selector-parser/dist/__tests__/comments.js
trusty-cms-4.1.6 node_modules/postcss-selector-parser/dist/__tests__/comments.js
trusty-cms-4.1.5 node_modules/postcss-selector-parser/dist/__tests__/comments.js
enju_library-0.3.8 spec/dummy/node_modules/postcss-modules-scope/node_modules/postcss-selector-parser/dist/__tests__/comments.js
enju_library-0.3.8 spec/dummy/node_modules/postcss-modules-local-by-default/node_modules/postcss-selector-parser/dist/__tests__/comments.js
jester-data-8.0.0 node_modules/postcss-modules-scope/node_modules/postcss-selector-parser/dist/__tests__/comments.js
jester-data-8.0.0 node_modules/postcss-modules-local-by-default/node_modules/postcss-selector-parser/dist/__tests__/comments.js