<commit_before>
var fs = require('fs'),
    test = require('tape'),
    concat = require('concat-stream'),
    stylestream = require('../')
    
test('resolving <link> element', function(t) {
  fs.createReadStream(__dirname + '/link.html')
  .pipe(stylestream({basepath: __dirname}))
  .pipe(concat({encoding: 'string'}, function(data) {
    t.equal(data, fs.readFileSync(__dirname + '/link.css').toString())
    t.end()
  }))
})

test('<style> element', function(t) {
  fs.createReadStream(__dirname + '/style.html')
  .pipe(stylestream({basepath: __dirname}))
  .pipe(concat({encoding: 'string'}, function(data) {
    t.equal(data.trim(), '.container { width: 900px; margin: 0 auto; }')
    t.end()
  }))
})<commit_msg>Test for error input<commit_after>
var fs = require('fs'),
    test = require('tape'),
    concat = require('concat-stream'),
    stylestream = require('../')
    
test('resolving <link> element', function(t) {
  fs.createReadStream(__dirname + '/link.html')
  .pipe(stylestream({basepath: __dirname}))
  .pipe(concat({encoding: 'string'}, function(data) {
    t.equal(data, fs.readFileSync(__dirname + '/link.css').toString())
    t.end()
  }))
})

test('<style> element', function(t) {
  fs.createReadStream(__dirname + '/style.html')
  .pipe(stylestream({basepath: __dirname}))
  .pipe(concat({encoding: 'string'}, function(data) {
    t.equal(data.trim(), '.container { width: 900px; margin: 0 auto; }')
    t.end()
  }))
})

test('error with no basepath', function(t) {
  fs.createReadStream(__dirname + '/link.html')
  .pipe(stylestream({}))
  .on('error', function (e) {
    t.ok(e)
    t.end()
  })
  .resume()
})
{'fraction_non_alphanumeric': 0.21010962241169306, 'fraction_numerical': 0.0048721071863581, 'mean_word_length': 4.199367088607595, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '449816', 'n_tokens_mistral': 579, 'n_tokens_neox': 565, 'n_words': 103}