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
4fd66035
Commit
4fd66035
authored
Sep 22, 2014
by
Nathan Houle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add sass-spec test suite
parent
0177fe8d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
0 deletions
+60
-0
.gitmodules
.gitmodules
+3
-0
sass-spec
test/sass-spec
+1
-0
sass-spec.js
test/sass-spec.js
+56
-0
No files found.
.gitmodules
View file @
4fd66035
[submodule "libsass"]
[submodule "libsass"]
path = libsass
path = libsass
url = git://github.com/hcatlin/libsass.git
url = git://github.com/hcatlin/libsass.git
[submodule "test/sass-spec"]
path = test/sass-spec
url = https://github.com/sass/sass-spec.git
sass-spec
@
d516aefa
Subproject commit d516aefa786f3cd3dd2914bb33d9760090176503
test/sass-spec.js
0 → 100644
View file @
4fd66035
var
assert
=
require
(
'assert'
),
fs
=
require
(
'fs'
),
path
=
require
(
'path'
),
sass
=
require
(
'../sass'
);
var
normalize
=
function
(
text
)
{
return
text
.
replace
(
/
\s
+/g
,
''
).
replace
(
'{'
,
'{
\
n'
).
replace
(
';'
,
';
\
n'
);
};
describe
(
'sass-spec'
,
function
()
{
var
sassSpecPath
=
path
.
join
(
__dirname
,
'sass-spec'
),
sassSpecDirExists
=
fs
.
existsSync
(
sassSpecPath
);
describe
(
'test directory'
,
function
()
{
it
(
'it should exist'
,
function
()
{
assert
.
ok
(
sassSpecDirExists
);
});
});
if
(
sassSpecDirExists
)
{
var
suitesPath
=
path
.
join
(
sassSpecPath
,
'spec'
);
var
suites
=
fs
.
readdirSync
(
suitesPath
);
var
ignoreSuites
=
[
'todo'
,
'benchmarks'
];
suites
.
forEach
(
function
(
suite
)
{
if
(
ignoreSuites
.
indexOf
(
suite
)
!==
-
1
)
{
return
;
}
describe
(
suite
,
function
()
{
var
suitePath
=
path
.
join
(
suitesPath
,
suite
);
var
tests
=
fs
.
readdirSync
(
suitePath
);
tests
.
forEach
(
function
(
test
)
{
var
testPath
=
path
.
join
(
suitePath
,
test
);
it
(
test
,
function
(
done
)
{
sass
.
render
({
file
:
path
.
join
(
testPath
,
'input.scss'
),
includePaths
:
[
testPath
,
path
.
join
(
testPath
,
'sub'
)],
success
:
function
(
css
)
{
var
expected
=
fs
.
readFileSync
(
path
.
join
(
testPath
,
'expected_output.css'
),
'utf-8'
);
assert
.
equal
(
normalize
(
css
),
normalize
(
expected
));
done
();
},
error
:
function
(
error
)
{
done
(
new
Error
(
error
));
}
});
});
});
});
});
}
});
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