/* eslint require-jsdoc: 0 */

var assert = require('power-assert');
var fs = require('fs');
var CssFile = require('../lib/cssfile');

function eq(value) {
  return function(x) {
    return x === value;
  };
}

describe('CssFile', function() {
  beforeEach(function() {
    this.css = new CssFile('examples/simple/app.css');
    var data = fs.readFileSync(this.css.path);
    this.css._initByContent(data.toString());
  });

  describe('#constructor', function() {
    it('should format result fill with null', function() {
      var result = this.css.result;
      assert.equal(result.length, 25);
      assert(result.every(eq(null)));
    });
  });

  describe('#mark', function() {
    it('should increase result', function() {
      this.css.mark(1, 0, 2);
      this.css.mark(1, 0, 1);
      var result = this.css.result;
      assert.equal(result[0], 2);
      assert.equal(result[1], 1);
      assert(result.slice(2).every(eq(null)));
    });
  });
});

@@ -1,56 +1,23 @@
-/* eslint require-jsdoc: 0 */%0A%0Avar assert = require(
+import assert from 
 'pow
@@ -30,38 +30,37 @@
 ert'
-)
 ;%0A
-var fs = require(
+import fs from 
 'fs'
-)
 ;%0A
-var
+import
  Css
@@ -68,18 +68,13 @@
 ile 
-= require(
+from 
 '../
@@ -85,17 +85,16 @@
 cssfile'
-)
 ;%0A%0Afunct
@@ -122,32 +122,12 @@
 urn 
-function(x) %7B%0A    return
+x =%3E
  x =
@@ -140,13 +140,8 @@
 ue;%0A
-  %7D;%0A
 %7D%0A%0Ad
@@ -163,56 +163,60 @@
 e', 
-function() %7B%0A  beforeEach(function()
+() =%3E %7B%0A  let css = null;%0A%0A  beforeEach(() =%3E
  %7B%0A    
-this.
 css 
@@ -261,19 +261,21 @@
 ');%0A    
-var
+const
  data = 
@@ -290,21 +290,16 @@
 ileSync(
-this.
 css.path
@@ -301,29 +301,24 @@
 .path);%0A    
-this.
 css._initByC
@@ -376,26 +376,21 @@
 uctor', 
-function()
+() =%3E
  %7B%0A    i
@@ -434,56 +434,15 @@
 l', 
-function() %7B%0A      var result = this.css.result;
+() =%3E %7B
 %0A   
@@ -453,24 +453,28 @@
 ssert.equal(
+css.
 result.lengt
@@ -490,24 +490,28 @@
      assert(
+css.
 result.every
@@ -558,26 +558,21 @@
 #mark', 
-function()
+() =%3E
  %7B%0A    i
@@ -603,18 +603,13 @@
 t', 
-function()
+() =%3E
  %7B%0A 
@@ -609,29 +609,24 @@
  =%3E %7B%0A      
-this.
 css.mark(1, 
@@ -638,21 +638,16 @@
 ;%0A      
-this.
 css.mark
@@ -661,43 +661,8 @@
 1);%0A
-      var result = this.css.result;
 %0A   
@@ -673,24 +673,28 @@
 ssert.equal(
+css.
 result%5B0%5D, 2
@@ -715,16 +715,20 @@
 t.equal(
+css.
 result%5B1
@@ -747,16 +747,20 @@
  assert(
+css.
 result.s

Translate 'test/cssfile.js' to ES2015