Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
public
/
sequelize
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
不要怂,就是干,撸起袖子干!
Commit 8fc9e329
authored
Jul 23, 2013
by
Sascha Depold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
utils test
1 parent
090dff97
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
test/utils.test.js
test/utils.test.js
View file @
8fc9e32
...
@@ -14,5 +14,33 @@ describe("Utils", function() {
...
@@ -14,5 +14,33 @@ describe("Utils", function() {
expect
(
result
).
not
.
to
.
match
(
/.*noot.*/
)
expect
(
result
).
not
.
to
.
match
(
/.*noot.*/
)
})
})
it
(
"removes lines comments in the middle of a line"
,
function
()
{
var
functionWithLineComments
=
function
()
{
alert
(
1
)
// noot noot
}
var
string
=
functionWithLineComments
.
toString
()
,
result
=
Utils
.
removeCommentsFromFunctionString
(
string
)
expect
(
result
).
not
.
to
.
match
(
/.*noot.*/
)
})
it
(
"removes range comments"
,
function
()
{
var
s
=
function
()
{
alert
(
1
)
/*
noot noot
*/
alert
(
2
)
/*
foo
*/
}.
toString
()
var
result
=
Utils
.
removeCommentsFromFunctionString
(
s
)
expect
(
result
).
not
.
to
.
match
(
/.*noot.*/
)
expect
(
result
).
not
.
to
.
match
(
/.*foo.*/
)
expect
(
result
).
to
.
match
(
/.*alert
\(
2
\)
.*/
)
})
})
})
})
})
Write
Preview
Markdown
is supported
Attach a file
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 post a comment