{"size": 1864, "ext": "js", "max_stars_repo_path": "test/utilitiesTests.js", "max_stars_repo_name": "turtledev-space/scss-to-json", "max_stars_repo_stars_event_min_datetime": "2015-10-21T05:15:25.000Z", "max_stars_repo_stars_event_max_datetime": "2021-11-29T14:55:00.000Z", "max_issues_repo_path": "test/utilitiesTests.js", "max_issues_repo_name": "turtledev-space/scss-to-json", "max_issues_repo_issues_event_min_datetime": "2015-10-21T05:29:54.000Z", "max_issues_repo_issues_event_max_datetime": "2022-01-05T11:53:49.000Z", "max_forks_repo_path": "test/utilitiesTests.js", "max_forks_repo_name": "turtledev-space/scss-to-json", "max_forks_repo_forks_event_min_datetime": "2015-10-21T05:21:22.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-30T15:03:50.000Z"}
{"max_stars_count": 52, "max_issues_count": 22, "max_forks_count": 42, "avg_line_length": 32.701754386, "max_line_length": 106, "alphanum_fraction": 0.6491416309}
'use strict';

var assert = require('assert');
var utilities = require('../src/utilities');

describe('Utilities', function() {
  describe('#stripNewLinesAndSemicolons', function() {
    it('should remove all new lines', function() {
      var input = '\nhello, I have\n some new lines\n and ;semicolons;';
      var output = 'hello, I have some new lines and semicolons';

      assert.strictEqual(utilities.stripNewLinesAndSemicolons(input), output);
    });
  });

  describe('#stripSpaces', function() {
    it('should remove all spaces', function() {
      var input = 'hello, I have some spaces';
      var output = 'hello,Ihavesomespaces';

      assert.strictEqual(utilities.stripSpaces(input), output);
    });
  });

  describe('#removeFlags', function() {
    it('should remove all flags', function() {
      var input = '!global hello, !default I have some spaces !global';
      var output = ' hello,  I have some spaces ';

      assert.strictEqual(utilities.removeFlags(input), output);
    });
  });

  describe('#removeInlineComments', function() {
    it('should remove inline comment if it is the entire line', function() {
      var input = '// this is a comment';
      var output = '';

      assert.strictEqual(utilities.removeInlineComments(input), output);
    });

    it('should remove inline comment if it is at the end of a line separated by a space', function() {
      var input = '1px solid blue // this is a comment';
      var output = '1px solid blue ';

      assert.strictEqual(utilities.removeInlineComments(input), output);
    });

    it('should remove inline comment if it is at the end of a line not separated by a space', function() {
      var input = '1px solid blue// this is a comment';
      var output = '1px solid blue';

      assert.strictEqual(utilities.removeInlineComments(input), output);
    });
  });
});
