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
fdd9868e
Commit
fdd9868e
authored
Sep 25, 2014
by
Adeel Mujahid
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #435 from juliangruber/assert-image-path
assert imagePath type
parents
7cbdcace
065cf4b7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
0 deletions
+19
-0
sass.js
sass.js
+4
-0
test.js
test/test.js
+15
-0
No files found.
sass.js
View file @
fdd9868e
...
...
@@ -70,6 +70,10 @@ var prepareOptions = function (options) {
prepareStats
(
options
,
stats
);
if
(
options
.
imagePath
&&
typeof
options
.
imagePath
!==
'string'
)
{
throw
new
Error
(
'imagePath needs to be a string'
);
}
return
{
file
:
options
.
file
||
null
,
outFile
:
options
.
outFile
||
null
,
...
...
test/test.js
View file @
fdd9868e
...
...
@@ -135,6 +135,21 @@ describe('compile file with image path', function(){
}
});
});
it
(
'should throw on non-string path'
,
function
(
done
)
{
try
{
sass
.
render
({
file
:
path
.
resolve
(
__dirname
,
'image_path.scss'
),
imagePath
:
[
'/path/to/images'
],
success
:
function
()
{},
error
:
function
()
{}
});
}
catch
(
err
)
{
assert
(
err
);
return
done
();
}
done
(
new
Error
(
'did not throw'
));
});
});
describe
(
'compile file'
,
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