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
2aa6ca57
Commit
2aa6ca57
authored
Sep 01, 2013
by
Arian Stolwijk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some extra CLI tests
parent
a75739e2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
0 deletions
+51
-0
cli.js
test/cli.js
+51
-0
No files found.
test/cli.js
View file @
2aa6ca57
...
...
@@ -8,6 +8,22 @@ var path = require('path'),
cliPath
=
path
.
resolve
(
__dirname
,
'..'
,
'bin'
,
'node-sass'
),
sampleFilename
=
path
.
resolve
(
__dirname
,
'sample.scss'
);
var
expectedSampleCompressed
=
'#navbar {width:80%;height:23px;}
\
#navbar ul {list-style-type:none;}
\
#navbar li {float:left;}
\
#navbar li a {font-weight:bold;}'
;
var
expectedSampleNoComments
=
'#navbar {
\
n
\
width: 80%;
\
n
\
height: 23px; }
\
n
\
\
n
\
#navbar ul {
\
n
\
list-style-type: none; }
\
n
\
\
n
\
#navbar li {
\
n
\
float: left; }
\
n
\
#navbar li a {
\
n
\
font-weight: bold; }
\
n'
;
describe
(
'cli'
,
function
()
{
it
(
'should print help when run with no arguments'
,
function
(
done
)
{
...
...
@@ -57,5 +73,40 @@ describe('cli', function() {
});
});
it
(
'should compile with the --output style'
,
function
(
done
){
var
emitter
=
cli
([
'--output-style'
,
'compressed'
,
__dirname
+
'/sample.scss'
]);
emitter
.
on
(
'error'
,
function
(
err
){
done
(
err
);
});
emitter
.
on
(
'render'
,
function
(
css
){
assert
.
equal
(
css
,
expectedSampleCompressed
);
done
();
});
});
it
(
'should compile with the --source-comments option'
,
function
(
done
){
var
emitter
=
cli
([
'--source-comments'
,
'none'
,
__dirname
+
'/sample.scss'
]);
emitter
.
on
(
'error'
,
function
(
err
){
done
(
err
);
});
emitter
.
on
(
'render'
,
function
(
css
){
assert
.
equal
(
css
,
expectedSampleNoComments
);
done
();
});
});
it
(
'should write the output to the file specified with the --output option'
,
function
(
done
){
var
resultPath
=
path
.
resolve
(
__dirname
,
'..'
,
'output.css'
);
var
emitter
=
cli
([
'--output'
,
resultPath
,
__dirname
+
'/sample.scss'
]);
emitter
.
on
(
'error'
,
function
(
err
){
done
(
err
);
});
emitter
.
on
(
'render'
,
function
(
css
){
fs
.
exists
(
resultPath
,
function
(
exists
)
{
assert
(
exists
);
fs
.
unlink
(
resultPath
,
done
);
});
});
});
});
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