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
5c1ad718
Commit
5c1ad718
authored
Jul 02, 2013
by
Mihkel Sokk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Basic tests for CLI
parent
fb421e29
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
0 deletions
+47
-0
cli.js
test/cli.js
+47
-0
No files found.
test/cli.js
0 → 100644
View file @
5c1ad718
var
path
=
require
(
'path'
),
assert
=
require
(
'assert'
),
fs
=
require
(
'fs'
),
exec
=
require
(
'child_process'
).
exec
,
sass
=
require
(
path
.
join
(
__dirname
,
'..'
,
'sass'
)),
cliPath
=
path
.
resolve
(
__dirname
,
'..'
,
'bin'
,
'node-sass'
),
sampleFilename
=
path
.
resolve
(
__dirname
,
'sample.scss'
);
describe
(
'cli'
,
function
()
{
it
(
'should print help when run with no arguments'
,
function
(
done
)
{
exec
(
cliPath
,
function
(
err
,
stdout
,
stderr
)
{
done
(
assert
(
stderr
.
indexOf
(
'Compile .scss files with node-sass'
)
===
0
));
});
});
it
(
'should compile sample.scss as sample.css'
,
function
(
done
)
{
var
resultPath
=
path
.
join
(
__dirname
,
'sample.css'
);
exec
(
cliPath
+
' '
+
sampleFilename
,
{
cwd
:
__dirname
},
function
(
err
,
stdout
,
stderr
)
{
fs
.
exists
(
resultPath
,
function
(
exists
)
{
done
(
assert
(
exists
));
fs
.
unlink
(
resultPath
,
function
()
{});
});
});
});
it
(
'should compile sample.scss to ../out.css'
,
function
(
done
)
{
var
resultPath
=
path
.
resolve
(
__dirname
,
'..'
,
'out.css'
);
exec
(
cliPath
+
' '
+
sampleFilename
+
' ../out.css'
,
{
cwd
:
__dirname
},
function
(
err
,
stdout
,
stderr
)
{
fs
.
exists
(
resultPath
,
function
(
exists
)
{
done
(
assert
(
exists
));
fs
.
unlink
(
resultPath
,
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