11'use strict' ;
22
3- var td = require ( 'testdouble' ) ;
4- var formatter = require ( 'stylelint' ) . formatters . string ;
3+ const td = require ( 'testdouble' ) ;
4+ const formatter = require ( 'stylelint' ) . formatters . string ;
55
6- var runCompilation = td . replace ( '../../lib/run-compilation' ) ;
6+ const runCompilation = td . replace ( '../../lib/run-compilation' ) ;
77
8- var LintDirtyModulesPlugin = require ( '../../lib/lint-dirty-modules-plugin' ) ;
8+ const LintDirtyModulesPlugin = require ( '../../lib/lint-dirty-modules-plugin' ) ;
99
10- var configFilePath = getPath ( './.stylelintrc' ) ;
11- var glob = require ( '../../lib/constants' ) . defaultFilesGlob ;
10+ const configFilePath = getPath ( './.stylelintrc' ) ;
11+ const glob = require ( '../../lib/constants' ) . defaultFilesGlob ;
1212
1313describe ( 'lint-dirty-modules-plugin' , function ( ) {
14- var LintDirtyModulesPluginCloned ;
15- var compilerMock ;
16- var optionsMock ;
14+ let LintDirtyModulesPluginCloned ;
15+ let compilerMock ;
16+ let optionsMock ;
1717
1818 beforeEach ( function ( ) {
1919 LintDirtyModulesPluginCloned = function ( ) {
@@ -38,15 +38,15 @@ describe('lint-dirty-modules-plugin', function () {
3838 } ) ;
3939
4040 it ( 'lint is called on "emit"' , function ( ) {
41- var lintStub = td . function ( ) ;
42- var doneStub = td . function ( ) ;
41+ const lintStub = td . function ( ) ;
42+ const doneStub = td . function ( ) ;
4343 LintDirtyModulesPluginCloned . prototype . lint = lintStub ;
44- var compilationMock = {
44+ const compilationMock = {
4545 fileTimestamps : {
4646 '/updated.scss' : 5
4747 }
4848 } ;
49- var plugin = new LintDirtyModulesPluginCloned ( compilerMock , optionsMock ) ;
49+ const plugin = new LintDirtyModulesPluginCloned ( compilerMock , optionsMock ) ;
5050
5151 compilerMock . callback ( compilationMock , doneStub ) ;
5252
@@ -55,14 +55,14 @@ describe('lint-dirty-modules-plugin', function () {
5555 } ) ;
5656
5757 context ( '#lint()' , function ( ) {
58- var getChangedFilesStub ;
59- var doneStub ;
60- var compilationMock ;
61- var fileTimestamps = {
58+ let getChangedFilesStub ;
59+ let doneStub ;
60+ let compilationMock ;
61+ const fileTimestamps = {
6262 '/test/changed.scss' : 5 ,
6363 '/test/newly-created.scss' : 5
6464 } ;
65- var pluginMock ;
65+ let pluginMock ;
6666 beforeEach ( function ( ) {
6767 getChangedFilesStub = td . function ( ) ;
6868 doneStub = td . function ( ) ;
@@ -86,8 +86,8 @@ describe('lint-dirty-modules-plugin', function () {
8686
8787 td . verify ( doneStub ( ) ) ;
8888 expect ( pluginMock . isFirstRun ) . to . eql ( false ) ;
89- td . verify ( getChangedFilesStub , { times : 0 , ignoreExtraArgs : true } ) ;
90- td . verify ( runCompilation , { times : 0 , ignoreExtraArgs : true } ) ;
89+ td . verify ( getChangedFilesStub ( ) , { times : 0 , ignoreExtraArgs : true } ) ;
90+ td . verify ( runCompilation ( ) , { times : 0 , ignoreExtraArgs : true } ) ;
9191 } ) ;
9292
9393 it ( 'runCompilation is not called if files are not changed' , function ( ) {
@@ -96,7 +96,7 @@ describe('lint-dirty-modules-plugin', function () {
9696 LintDirtyModulesPluginCloned . prototype . lint . call ( pluginMock , compilationMock , doneStub ) ;
9797
9898 td . verify ( doneStub ( ) ) ;
99- td . verify ( runCompilation , { times : 0 , ignoreExtraArgs : true } ) ;
99+ td . verify ( runCompilation ( ) , { times : 0 , ignoreExtraArgs : true } ) ;
100100 } ) ;
101101
102102 it ( 'runCompilation is called if styles are changed' , function ( ) {
@@ -113,7 +113,7 @@ describe('lint-dirty-modules-plugin', function () {
113113 } ) ;
114114
115115 context ( '#getChangedFiles()' , function ( ) {
116- var pluginMock ;
116+ let pluginMock ;
117117 before ( function ( ) {
118118 pluginMock = {
119119 compiler : compilerMock ,
@@ -129,13 +129,13 @@ describe('lint-dirty-modules-plugin', function () {
129129 } ) ;
130130
131131 it ( 'returns changed style files' , function ( ) {
132- var fileTimestamps = {
132+ const fileTimestamps = {
133133 '/test/changed.scss' : 20 ,
134134 '/test/changed.js' : 20 ,
135135 '/test/newly-created.scss' : 15
136136 } ;
137137
138- var changedFiles = LintDirtyModulesPluginCloned . prototype . getChangedFiles . call ( pluginMock , fileTimestamps , glob ) ;
138+ const changedFiles = LintDirtyModulesPluginCloned . prototype . getChangedFiles . call ( pluginMock , fileTimestamps , glob ) ;
139139
140140 expect ( changedFiles ) . to . eql ( [
141141 '/test/changed.scss' ,
0 commit comments