Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
node-sass
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
楚学文
node-sass
Commits
a3ae9667
Unverified
Commit
a3ae9667
authored
Nov 15, 2017
by
Michael Mifsud
Committed by
GitHub
Nov 15, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2151 from sass/more-watcher-fixes
Fix watching of entry points
parents
e3ca0757
2326b5f4
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
405 additions
and
80 deletions
+405
-80
node-sass
bin/node-sass
+0
-2
watcher.js
lib/watcher.js
+10
-1
_one.scss
test/fixtures/watcher/main/partials/_one.scss
+2
-0
_two.scss
test/fixtures/watcher/main/partials/_two.scss
+2
-0
three.scss
test/fixtures/watcher/main/three.scss
+3
-0
two.scss
test/fixtures/watcher/main/two.scss
+0
-2
watcher.js
test/watcher.js
+388
-75
No files found.
bin/node-sass
View file @
a3ae9667
...
...
@@ -250,8 +250,6 @@ function watch(options, emitter) {
});
};
watcher
.
reset
(
options
);
var
gaze
=
new
Gaze
();
gaze
.
add
(
watcher
.
reset
(
options
));
gaze
.
on
(
'error'
,
emitter
.
emit
.
bind
(
emitter
,
'error'
));
...
...
lib/watcher.js
View file @
a3ae9667
var
grapher
=
require
(
'sass-graph'
),
clonedeep
=
require
(
'lodash.clonedeep'
),
path
=
require
(
'path'
),
config
=
{},
watcher
=
{},
graph
=
null
;
...
...
@@ -30,8 +31,14 @@ watcher.changed = function(absolutePath) {
this
.
reset
();
if
(
absolutePath
&&
path
.
basename
(
absolutePath
)[
0
]
!==
'_'
)
{
files
.
changed
.
push
(
absolutePath
);
}
graph
.
visitAncestors
(
absolutePath
,
function
(
parent
)
{
if
(
path
.
basename
(
parent
)[
0
]
!==
'_'
)
{
files
.
changed
.
push
(
parent
);
}
});
graph
.
visitDescendents
(
absolutePath
,
function
(
child
)
{
...
...
@@ -50,7 +57,7 @@ watcher.added = function(absolutePath) {
this
.
reset
();
if
(
Object
.
keys
(
graph
.
index
).
indexOf
(
absolutePath
)
!
==
-
1
)
{
if
(
Object
.
keys
(
graph
.
index
).
indexOf
(
absolutePath
)
=
==
-
1
)
{
files
.
added
.
push
(
absolutePath
);
}
...
...
@@ -69,7 +76,9 @@ watcher.removed = function(absolutePath) {
};
graph
.
visitAncestors
(
absolutePath
,
function
(
parent
)
{
if
(
path
.
basename
(
parent
)[
0
]
!==
'_'
)
{
files
.
changed
.
push
(
parent
);
}
});
if
(
Object
.
keys
(
graph
.
index
).
indexOf
(
absolutePath
)
!==
-
1
)
{
...
...
test/fixtures/watcher/main/partials/_one.scss
View file @
a3ae9667
@import
"partials/three"
;
.one
{
color
:
darkred
;
}
test/fixtures/watcher/main/partials/_two.scss
View file @
a3ae9667
@import
"partials/three"
;
.two
{
color
:
darkblue
;
}
test/fixtures/watcher/main/three.scss
0 → 100644
View file @
a3ae9667
.three
{
color
:
green
;
}
test/fixtures/watcher/main/two.scss
View file @
a3ae9667
@import
"partials/two"
;
.two
{
color
:
blue
;
}
test/watcher.js
View file @
a3ae9667
...
...
@@ -20,37 +20,67 @@ describe('watcher', function() {
beforeEach
(
function
()
{
watcher
.
reset
({
directory
:
main
,
loadPaths
:
[
main
]
includePath
:
[
main
]
});
});
describe
(
'when a file is changed in the graph'
,
function
()
{
it
(
'should return the files to compile'
,
function
()
{
var
files
=
watcher
.
changed
(
path
.
join
(
main
,
'partials'
,
'_one.scss'
));
assert
.
deepEqual
(
files
,
{
added
:
[],
changed
:
[
path
.
join
(
main
,
'one.scss'
)],
removed
:
[],
describe
(
'when a file is changed'
,
function
()
{
describe
(
'and it is in the graph'
,
function
()
{
describe
(
'if it is a partial'
,
function
()
{
it
(
'should record its ancestors as changed'
,
function
()
{
var
file
=
path
.
join
(
main
,
'partials'
,
'_one.scss'
);
var
files
=
watcher
.
changed
(
file
);
assert
.
deepEqual
(
files
.
changed
,
[
path
.
join
(
main
,
'one.scss'
),
]);
});
it
(
'should record its decendants as added'
,
function
()
{
var
file
=
path
.
join
(
main
,
'partials'
,
'_one.scss'
);
var
files
=
watcher
.
changed
(
file
);
assert
.
deepEqual
(
files
.
added
,
[
path
.
join
(
main
,
'partials'
,
'_three.scss'
),
]);
});
describe
(
'and @imports previously not imported files'
,
function
()
{
it
(
'should also return the new imported files'
,
function
()
{
it
(
'should record nothing as removed'
,
function
()
{
var
file
=
path
.
join
(
main
,
'partials'
,
'_one.scss'
);
fs
.
writeFileSync
(
file
,
'@import "partials/three.scss";'
,
{
flag
:
'a'
});
var
files
=
watcher
.
changed
(
file
);
assert
.
deepEqual
(
files
,
{
added
:
[
path
.
join
(
main
,
'partials'
,
'_three.scss'
)],
changed
:
[
path
.
join
(
main
,
'one.scss'
)],
removed
:
[],
assert
.
deepEqual
(
files
.
removed
,
[]);
});
});
describe
(
'if it is not a partial'
,
function
()
{
it
(
'should record itself as changed'
,
function
()
{
var
file
=
path
.
join
(
main
,
'one.scss'
);
var
files
=
watcher
.
changed
(
file
);
assert
.
deepEqual
(
files
.
changed
,
[
file
,
]);
});
it
(
'should record its decendants as added'
,
function
()
{
var
file
=
path
.
join
(
main
,
'one.scss'
);
var
files
=
watcher
.
changed
(
file
);
assert
.
deepEqual
(
files
.
added
,
[
path
.
join
(
main
,
'partials'
,
'_one.scss'
),
path
.
join
(
main
,
'partials'
,
'_three.scss'
),
]);
});
it
(
'should record nothing as removed'
,
function
()
{
var
file
=
path
.
join
(
main
,
'one.scss'
);
var
files
=
watcher
.
changed
(
file
);
assert
.
deepEqual
(
files
.
removed
,
[]);
});
});
});
describe
(
'when a file is changed outside the graph'
,
function
()
{
it
(
'should return an empty array'
,
function
()
{
var
files
=
watcher
.
changed
(
path
.
join
(
sibling
,
'partials'
,
'_three.scss'
));
describe
(
'and is not in the graph'
,
function
()
{
describe
(
'if it is a partial'
,
function
()
{
it
(
'should not record anything'
,
function
()
{
var
file
=
path
.
join
(
sibling
,
'partials'
,
'_three.scss'
);
var
files
=
watcher
.
changed
(
file
);
assert
.
deepEqual
(
files
,
{
added
:
[],
changed
:
[],
...
...
@@ -59,60 +89,143 @@ describe('watcher', function() {
});
});
describe
(
'when a file is added in the graph'
,
function
()
{
it
(
'should return only the added file'
,
function
()
{
var
file
=
path
.
join
(
main
,
'three.scss'
);
fs
.
writeFileSync
(
file
,
'@import "paritals/two.scss";'
);
var
files
=
watcher
.
added
(
file
);
describe
(
'if it is not a partial'
,
function
()
{
it
(
'should record itself as changed'
,
function
()
{
var
file
=
path
.
join
(
sibling
,
'three.scss'
);
var
files
=
watcher
.
changed
(
file
);
assert
.
deepEqual
(
files
,
{
added
:
[
file
],
changed
:
[
],
added
:
[
],
changed
:
[
file
],
removed
:
[],
});
});
});
});
});
describe
(
'and @imports previously not imported files'
,
function
()
{
it
(
'should also return the new imported files'
,
function
()
{
var
file
=
path
.
join
(
main
,
'three.scss'
);
fs
.
writeFileSync
(
file
,
'@import "partials/three.scss";'
);
describe
(
'when a file is added'
,
function
()
{
describe
(
'and it is in the graph'
,
function
()
{
describe
(
'if it is a partial'
,
function
()
{
it
(
'should record nothing as added'
,
function
()
{
var
file
=
path
.
join
(
main
,
'partials'
,
'_three.scss'
);
var
files
=
watcher
.
added
(
file
);
assert
.
deepEqual
(
files
,
{
added
:
[
file
,
assert
.
deepEqual
(
files
.
added
,
[]);
});
it
(
'should record its decendants as added'
,
function
()
{
var
file
=
path
.
join
(
main
,
'partials'
,
'_one.scss'
);
var
files
=
watcher
.
added
(
file
);
assert
.
deepEqual
(
files
.
added
,
[
path
.
join
(
main
,
'partials'
,
'_three.scss'
)
],
changed
:
[],
removed
:
[],
]);
});
it
(
'should record nothing as changed'
,
function
()
{
var
file
=
path
.
join
(
main
,
'partials'
,
'_three.scss'
);
var
files
=
watcher
.
added
(
file
);
assert
.
deepEqual
(
files
.
changed
,
[]);
});
it
(
'should record nothing as removed'
,
function
()
{
var
file
=
path
.
join
(
main
,
'partials'
,
'_three.scss'
);
var
files
=
watcher
.
added
(
file
);
assert
.
deepEqual
(
files
.
removed
,
[]);
});
});
describe
(
'when a file is added outside the graph'
,
function
()
{
it
(
'should return an empty array'
,
function
()
{
var
files
=
watcher
.
added
(
path
.
join
(
sibling
,
'three.scss'
));
assert
.
deepEqual
(
files
,
{
added
:
[],
changed
:
[],
removed
:
[],
describe
(
'if it is not a partial'
,
function
()
{
it
(
'should record nothing as added'
,
function
()
{
var
file
=
path
.
join
(
main
,
'three.scss'
);
var
files
=
watcher
.
added
(
file
);
assert
.
deepEqual
(
files
.
added
,
[]);
});
it
(
'should record its decendants as added'
,
function
()
{
var
file
=
path
.
join
(
main
,
'one.scss'
);
var
files
=
watcher
.
added
(
file
);
assert
.
deepEqual
(
files
.
added
,
[
path
.
join
(
main
,
'partials'
,
'_one.scss'
),
path
.
join
(
main
,
'partials'
,
'_three.scss'
),
]);
});
it
(
'should record nothing as changed'
,
function
()
{
var
file
=
path
.
join
(
main
,
'one.scss'
);
var
files
=
watcher
.
added
(
file
);
assert
.
deepEqual
(
files
.
changed
,
[]);
});
it
(
'should record nothing as removed'
,
function
()
{
var
file
=
path
.
join
(
main
,
'one.scss'
);
var
files
=
watcher
.
added
(
file
);
assert
.
deepEqual
(
files
.
removed
,
[]);
});
});
});
});
describe
(
'when a file is removed'
,
function
()
{
describe
(
'and it is in the graph'
,
function
()
{
describe
(
'if it is a partial'
,
function
()
{
it
(
'should record nothing as added'
,
function
()
{
var
file
=
path
.
join
(
main
,
'partials'
,
'_one.scss'
);
var
files
=
watcher
.
removed
(
file
);
assert
.
deepEqual
(
files
.
added
,
[]);
});
it
(
'should record its ancestors as changed'
,
function
()
{
var
file
=
path
.
join
(
main
,
'partials'
,
'_one.scss'
);
var
files
=
watcher
.
removed
(
file
);
assert
.
deepEqual
(
files
.
changed
,
[
path
.
join
(
main
,
'one.scss'
),
]);
});
it
(
'should record itself as removed'
,
function
()
{
var
file
=
path
.
join
(
main
,
'partials'
,
'_one.scss'
);
var
files
=
watcher
.
removed
(
file
);
assert
.
deepEqual
(
files
.
removed
,
[
file
]);
});
});
describe
(
'if it is not a partial'
,
function
()
{
it
(
'should record nothing as added'
,
function
()
{
var
file
=
path
.
join
(
main
,
'one.scss'
);
var
files
=
watcher
.
removed
(
file
);
assert
.
deepEqual
(
files
.
added
,
[]);
});
it
(
'should record nothing as changed'
,
function
()
{
var
file
=
path
.
join
(
main
,
'one.scss'
);
var
files
=
watcher
.
removed
(
file
);
assert
.
deepEqual
(
files
.
changed
,
[]);
});
it
(
'should record itself as removed'
,
function
()
{
var
file
=
path
.
join
(
main
,
'one.scss'
);
var
files
=
watcher
.
removed
(
file
);
assert
.
deepEqual
(
files
.
removed
,
[
file
]);
});
});
});
describe
(
'when a file is removed from the graph'
,
function
()
{
it
(
'should return the files to compile'
,
function
()
{
var
files
=
watcher
.
removed
(
path
.
join
(
main
,
'partials'
,
'_one.scss'
));
describe
(
'and is not in the graph'
,
function
()
{
describe
(
'if it is a partial'
,
function
()
{
it
(
'should record nothing'
,
function
()
{
var
file
=
path
.
join
(
sibling
,
'partials'
,
'_three.scss'
);
var
files
=
watcher
.
removed
(
file
);
assert
.
deepEqual
(
files
,
{
added
:
[],
changed
:
[
path
.
join
(
main
,
'one.scss'
)
],
removed
:
[
path
.
join
(
main
,
'partials'
,
'_one.scss'
)
],
changed
:
[
],
removed
:
[
],
});
});
});
describe
(
'when a file is removed from outside the graph'
,
function
()
{
it
(
'should return an empty array'
,
function
()
{
var
files
=
watcher
.
removed
(
path
.
join
(
sibling
,
'partials'
,
'_three.scss'
));
describe
(
'if it is not a partial'
,
function
()
{
it
(
'should record nothing'
,
function
()
{
var
file
=
path
.
join
(
sibling
,
'three.scss'
);
var
files
=
watcher
.
removed
(
file
);
assert
.
deepEqual
(
files
,
{
added
:
[],
changed
:
[],
...
...
@@ -121,29 +234,72 @@ describe('watcher', function() {
});
});
});
});
});
describe
(
'with file'
,
function
()
{
beforeEach
(
function
()
{
watcher
.
reset
({
src
:
path
.
join
(
main
,
'one.scss'
),
loadPaths
:
[
main
]
includePath
:
[
main
]
});
});
describe
(
'when a file is changed in the graph'
,
function
()
{
it
(
'should return the files to compile'
,
function
()
{
var
files
=
watcher
.
changed
(
path
.
join
(
main
,
'partials'
,
'_one.scss'
));
assert
.
deepEqual
(
files
,
{
added
:
[],
changed
:
[
path
.
join
(
main
,
'one.scss'
)],
removed
:
[],
describe
(
'when a file is changed'
,
function
()
{
describe
(
'and it is in the graph'
,
function
()
{
describe
(
'if it is a partial'
,
function
()
{
it
(
'should record its decendents as added'
,
function
()
{
var
file
=
path
.
join
(
main
,
'partials'
,
'_one.scss'
);
var
files
=
watcher
.
changed
(
file
);
assert
.
deepEqual
(
files
.
added
,
[
path
.
join
(
main
,
'partials'
,
'_three.scss'
),
]);
});
it
(
'should record its ancenstors as changed'
,
function
()
{
var
file
=
path
.
join
(
main
,
'partials'
,
'_one.scss'
);
var
files
=
watcher
.
changed
(
file
);
assert
.
deepEqual
(
files
.
changed
,
[
path
.
join
(
main
,
'one.scss'
),
]);
});
it
(
'should record nothing as removed'
,
function
()
{
var
file
=
path
.
join
(
main
,
'partials'
,
'_one.scss'
);
var
files
=
watcher
.
changed
(
file
);
assert
.
deepEqual
(
files
.
removed
,
[]);
});
});
describe
(
'if it is not a partial'
,
function
()
{
it
(
'should record its decendents as added'
,
function
()
{
var
file
=
path
.
join
(
main
,
'one.scss'
);
var
files
=
watcher
.
changed
(
file
);
assert
.
deepEqual
(
files
.
added
,
[
path
.
join
(
main
,
'partials'
,
'_one.scss'
),
path
.
join
(
main
,
'partials'
,
'_three.scss'
),
]);
});
it
(
'should record itself as changed'
,
function
()
{
var
file
=
path
.
join
(
main
,
'one.scss'
);
var
files
=
watcher
.
changed
(
file
);
assert
.
deepEqual
(
files
.
changed
,
[
file
]);
});
it
(
'should record nothing as removed'
,
function
()
{
var
file
=
path
.
join
(
main
,
'one.scss'
);
var
files
=
watcher
.
changed
(
file
);
assert
.
deepEqual
(
files
.
removed
,
[]);
});
});
});
describe
(
'when a file is changed outside the graph'
,
function
()
{
it
(
'should return an empty array'
,
function
()
{
var
files
=
watcher
.
changed
(
path
.
join
(
sibling
,
'partials'
,
'_three.scss'
));
describe
(
'and it is not in the graph'
,
function
()
{
describe
(
'if it is a partial'
,
function
()
{
it
(
'should record nothing'
,
function
()
{
var
file
=
path
.
join
(
sibling
,
'partials'
,
'_three.scss'
);
var
files
=
watcher
.
changed
(
file
);
assert
.
deepEqual
(
files
,
{
added
:
[],
changed
:
[],
...
...
@@ -152,33 +308,188 @@ describe('watcher', function() {
});
});
describe
(
'if it is not a partial'
,
function
()
{
it
(
'should record nothing as added'
,
function
()
{
var
file
=
path
.
join
(
sibling
,
'three.scss'
);
var
files
=
watcher
.
changed
(
file
);
assert
.
deepEqual
(
files
.
added
,
[]);
});
it
(
'should record itself as changed'
,
function
()
{
var
file
=
path
.
join
(
sibling
,
'three.scss'
);
var
files
=
watcher
.
changed
(
file
);
assert
.
deepEqual
(
files
.
changed
,
[
file
]);
});
it
(
'should record nothing as removed'
,
function
()
{
var
file
=
path
.
join
(
sibling
,
'three.scss'
);
var
files
=
watcher
.
changed
(
file
);
assert
.
deepEqual
(
files
.
removed
,
[]);
});
});
});
});
describe
(
'when a file is added'
,
function
()
{
it
(
'should return an empty array'
,
function
()
{
describe
(
'and it is in the graph'
,
function
()
{
it
(
'should record nothing as added'
,
function
()
{
var
file
=
path
.
join
(
main
,
'partials'
,
'_three.scss'
);
var
files
=
watcher
.
added
(
file
);
assert
.
deepEqual
(
files
.
added
,
[]);
});
it
(
'should record its decendants as added'
,
function
()
{
var
file
=
path
.
join
(
main
,
'partials'
,
'_one.scss'
);
var
files
=
watcher
.
added
(
file
);
assert
.
deepEqual
(
files
.
added
,
[
path
.
join
(
main
,
'partials'
,
'_three.scss'
),
]);
});
it
(
'should record nothing as changed'
,
function
()
{
var
file
=
path
.
join
(
main
,
'partials'
,
'_three.scss'
);
var
files
=
watcher
.
added
(
file
);
assert
.
deepEqual
(
files
.
changed
,
[]);
});
it
(
'should record nothing as removed'
,
function
()
{
var
file
=
path
.
join
(
main
,
'partials'
,
'_three.scss'
);
var
files
=
watcher
.
added
(
file
);
assert
.
deepEqual
(
files
.
removed
,
[]);
});
});
describe
(
'and it is not in the graph'
,
function
()
{
beforeEach
(
function
()
{
watcher
.
reset
({
src
:
path
.
join
(
main
,
'two.scss'
),
includePath
:
[
main
]
});
});
describe
(
'if it is a partial'
,
function
()
{
it
(
'should record nothing as added'
,
function
()
{
var
file
=
path
.
join
(
main
,
'partials'
,
'_three.scss'
);
var
files
=
watcher
.
added
(
file
);
assert
.
deepEqual
(
files
.
added
,
[
file
,
]);
});
it
(
'should not record its decendants as added'
,
function
()
{
var
file
=
path
.
join
(
main
,
'partials'
,
'_one.scss'
);
var
files
=
watcher
.
added
(
file
);
assert
.
deepEqual
(
files
.
added
,
[
file
,
]);
});
it
(
'should record nothing as changed'
,
function
()
{
var
file
=
path
.
join
(
main
,
'partials'
,
'_three.scss'
);
var
files
=
watcher
.
added
(
file
);
assert
.
deepEqual
(
files
.
changed
,
[]);
});
it
(
'should record nothing as removed'
,
function
()
{
var
file
=
path
.
join
(
main
,
'partials'
,
'_three.scss'
);
var
files
=
watcher
.
added
(
file
);
assert
.
deepEqual
(
files
.
removed
,
[]);
});
});
describe
(
'if it is not a partial'
,
function
()
{
it
(
'should record itself as added'
,
function
()
{
var
file
=
path
.
join
(
main
,
'three.scss'
);
fs
.
writeFileSync
(
file
,
'@import "paritals/one.scss";'
);
var
files
=
watcher
.
added
(
file
);
assert
.
deepEqual
(
files
,
{
added
:
[],
changed
:
[],
removed
:
[],
assert
.
deepEqual
(
files
.
added
,
[
file
,
]);
});
it
(
'should record nothing as changed'
,
function
()
{
var
file
=
path
.
join
(
main
,
'one.scss'
);
var
files
=
watcher
.
added
(
file
);
assert
.
deepEqual
(
files
.
changed
,
[]);
});
it
(
'should record nothing as removed'
,
function
()
{
var
file
=
path
.
join
(
main
,
'one.scss'
);
var
files
=
watcher
.
added
(
file
);
assert
.
deepEqual
(
files
.
removed
,
[]);
});
});
});
});
describe
(
'when a file is removed'
,
function
()
{
describe
(
'and it is in the graph'
,
function
()
{
describe
(
'if it is a partial'
,
function
()
{
it
(
'should record nothing as added'
,
function
()
{
var
file
=
path
.
join
(
main
,
'partials'
,
'_one.scss'
);
var
files
=
watcher
.
removed
(
file
);
assert
.
deepEqual
(
files
.
added
,
[]);
});
it
(
'should record its ancestors as changed'
,
function
()
{
var
file
=
path
.
join
(
main
,
'partials'
,
'_one.scss'
);
var
files
=
watcher
.
removed
(
file
);
assert
.
deepEqual
(
files
.
changed
,
[
path
.
join
(
main
,
'one.scss'
),
]);
});
it
(
'should record itself as removed'
,
function
()
{
var
file
=
path
.
join
(
main
,
'partials'
,
'_one.scss'
);
var
files
=
watcher
.
removed
(
file
);
assert
.
deepEqual
(
files
.
removed
,
[
file
]);
});
});
describe
(
'if it is not a partial'
,
function
()
{
it
(
'should record nothing as added'
,
function
()
{
var
file
=
path
.
join
(
main
,
'one.scss'
);
var
files
=
watcher
.
removed
(
file
);
assert
.
deepEqual
(
files
.
added
,
[]);
});
it
(
'should record nothing as changed'
,
function
()
{
var
file
=
path
.
join
(
main
,
'one.scss'
);
var
files
=
watcher
.
removed
(
file
);
assert
.
deepEqual
(
files
.
changed
,
[]);
});
it
(
'should record itself as removed'
,
function
()
{
var
file
=
path
.
join
(
main
,
'one.scss'
);
var
files
=
watcher
.
removed
(
file
);
assert
.
deepEqual
(
files
.
removed
,
[
file
]);
});
});
});
describe
(
'and is not in the graph'
,
function
()
{
beforeEach
(
function
()
{
watcher
.
reset
({
src
:
path
.
join
(
main
,
'two.scss'
),
includePath
:
[
main
]
});
});
describe
(
'when a file is removed from the graph'
,
function
()
{
it
(
'should return the files to compile'
,
function
()
{
var
files
=
watcher
.
removed
(
path
.
join
(
main
,
'partials'
,
'_one.scss'
));
describe
(
'if it is a partial'
,
function
()
{
it
(
'should record nothing as added'
,
function
()
{
var
file
=
path
.
join
(
main
,
'partials'
,
'_one.scss'
);
var
files
=
watcher
.
removed
(
file
);
assert
.
deepEqual
(
files
,
{
added
:
[],
changed
:
[
path
.
join
(
main
,
'one.scss'
)
],
removed
:
[
path
.
join
(
main
,
'partials'
,
'_one.scss'
)
],
changed
:
[
],
removed
:
[
],
});
});
});
describe
(
'when a file is removed from outside the graph'
,
function
()
{
it
(
'should return an empty array'
,
function
()
{
var
files
=
watcher
.
removed
(
path
.
join
(
sibling
,
'partials'
,
'_three.scss'
));
describe
(
'if it is not a partial'
,
function
()
{
it
(
'should record nothing'
,
function
()
{
var
file
=
path
.
join
(
main
,
'one.scss'
);
var
files
=
watcher
.
removed
(
file
);
assert
.
deepEqual
(
files
,
{
added
:
[],
changed
:
[],
...
...
@@ -187,4 +498,6 @@ describe('watcher', function() {
});
});
});
});
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment