<commit_before>'use strict';

var expect = require('chai').expect;
var Sass = require('../dist/sass.sync.js');

describe('Sass.compile()', function() {

  it('should return CSS', function(done) {
    var source = '$foo:123px;\n\n.m {\n  width:$foo;\n}';
    var expected = '.m {\n  width: 123px; }\n';

    Sass.options('defaults');

    Sass.compile(source, function(result) {
      expect(result).to.be.a('object');
      expect(result.map).to.be.a('object');
      expect(result.text).to.equal(expected);

      done();
    });
  });

  it('should return parse errors', function(done) {
    var source = '$foo:123px;\n\n.m {\n  width:$foo;\n}\n\nfoobar';

    Sass.options('defaults');

    Sass.compile(source, function(result) {
      expect(result).to.be.a('object');
      expect(result.line).to.equal(7);
      expect(result.message).to.equal('invalid top-level expression');

      done();
    });
  });

  it('should accept options', function(done) {<commit_msg>fix(test): error message format was changed in 3.3<commit_after>'use strict';

var expect = require('chai').expect;
var Sass = require('../dist/sass.sync.js');

describe('Sass.compile()', function() {

  it('should return CSS', function(done) {
    var source = '$foo:123px;\n\n.m {\n  width:$foo;\n}';
    var expected = '.m {\n  width: 123px; }\n';

    Sass.options('defaults');

    Sass.compile(source, function(result) {
      expect(result).to.be.a('object');
      expect(result.map).to.be.a('object');
      expect(result.text).to.equal(expected);

      done();
    });
  });

  it('should return parse errors', function(done) {
    var source = '$foo:123px;\n\n.m {\n  width:$foo;\n}\n\nfoobar';

    Sass.options('defaults');

    Sass.compile(source, function(result) {
      expect(result).to.be.a('object');
      expect(result.line).to.equal(7);
      expect(result.message).to.include('Invalid CSS after "foobar":');

      done();
    });
  });

  it('should accept options', function(done) {
{'fraction_non_alphanumeric': 0.20787083753784055, 'fraction_numerical': 0.011099899091826439, 'mean_word_length': 3.320261437908497, 'pattern_counts': {'":': 1, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1836159', 'n_tokens_mistral': 705, 'n_tokens_neox': 662, 'n_words': 120}