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
fa25f82b
Commit
fa25f82b
authored
Sep 06, 2014
by
Adeel Mujahid
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #413 from kevva/test
Add stdin test
parents
7a2d373f
4a4bba8c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
cli.js
test/cli.js
+14
-0
No files found.
test/cli.js
View file @
fa25f82b
...
@@ -2,6 +2,7 @@ var path = require('path'),
...
@@ -2,6 +2,7 @@ var path = require('path'),
assert
=
require
(
'assert'
),
assert
=
require
(
'assert'
),
fs
=
require
(
'fs'
),
fs
=
require
(
'fs'
),
exec
=
require
(
'child_process'
).
exec
,
exec
=
require
(
'child_process'
).
exec
,
spawn
=
require
(
'child_process'
).
spawn
,
assign
=
require
(
'object-assign'
),
assign
=
require
(
'object-assign'
),
cli
=
process
.
env
.
NODESASS_COVERAGE
?
require
(
'../lib-coverage/cli'
)
:
require
(
'../lib/cli'
),
cli
=
process
.
env
.
NODESASS_COVERAGE
?
require
(
'../lib-coverage/cli'
)
:
require
(
'../lib/cli'
),
cliPath
=
path
.
resolve
(
__dirname
,
'../bin/node-sass'
),
cliPath
=
path
.
resolve
(
__dirname
,
'../bin/node-sass'
),
...
@@ -32,6 +33,19 @@ var sampleCssOutputPath = path.join(__dirname, '../sample.css');
...
@@ -32,6 +33,19 @@ var sampleCssOutputPath = path.join(__dirname, '../sample.css');
var
sampleCssMapOutputPath
=
path
.
join
(
__dirname
,
'../sample.css.map'
);
var
sampleCssMapOutputPath
=
path
.
join
(
__dirname
,
'../sample.css.map'
);
describe
(
'cli'
,
function
()
{
describe
(
'cli'
,
function
()
{
it
(
'should read data from stdin'
,
function
(
done
)
{
var
src
=
fs
.
createReadStream
(
sampleScssPath
);
var
emitter
=
spawn
(
cliPath
,
[
'--stdout'
]);
emitter
.
stdout
.
on
(
'data'
,
function
(
data
)
{
data
=
data
.
toString
().
trim
();
assert
.
equal
(
data
,
expectedSampleNoComments
.
trim
());
done
();
});
src
.
pipe
(
emitter
.
stdin
);
});
it
(
'should print help when run with no arguments'
,
function
(
done
)
{
it
(
'should print help when run with no arguments'
,
function
(
done
)
{
var
env
=
assign
(
process
.
env
,
{
isTTY
:
true
});
var
env
=
assign
(
process
.
env
,
{
isTTY
:
true
});
exec
(
'node '
+
cliPath
,
{
exec
(
'node '
+
cliPath
,
{
...
...
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