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
acae62bc
Commit
acae62bc
authored
Dec 18, 2014
by
Adeel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Importer: Adds tests for render and renderSync.
parent
fd6a32c0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
+35
-0
api.js
test/api.js
+35
-0
No files found.
test/api.js
View file @
acae62bc
...
...
@@ -133,6 +133,24 @@ describe('api', function() {
}
});
});
it
(
'should override imports with custom importer'
,
function
(
done
)
{
var
src
=
read
(
fixture
(
'include-files/index.scss'
),
'utf8'
);
sass
.
render
({
data
:
src
,
success
:
function
(
result
)
{
assert
.
equal
(
result
.
css
.
trim
(),
'div {
\
n color: yellow; }
\
n
\
ndiv {
\
n color: yellow; }'
);
done
();
},
importer
:
function
(
url
,
prev
,
done
)
{
done
({
file
:
'/some/other/path.scss'
,
contents
:
'div {color: yellow;}'
});
}
});
});
});
describe
(
'.renderSync(options)'
,
function
()
{
...
...
@@ -164,6 +182,23 @@ describe('api', function() {
done
();
});
it
(
'should override imports with custom importer'
,
function
(
done
)
{
var
src
=
read
(
fixture
(
'include-files/index.scss'
),
'utf8'
);
var
result
=
sass
.
renderSync
({
data
:
src
,
importer
:
function
(
url
,
prev
,
finish
)
{
finish
({
file
:
'/some/other/path.scss'
,
contents
:
'div {color: yellow;}'
});
}
});
assert
.
equal
(
result
.
css
.
trim
(),
'div {
\
n color: yellow; }
\
n
\
ndiv {
\
n color: yellow; }'
);
done
();
});
});
describe
(
'.render({stats: {}})'
,
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