Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jquery
Project
Project
Details
Activity
Releases
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
夏彬
jquery
Commits
6fc2c675
Commit
6fc2c675
authored
May 06, 2008
by
Ariel Flesler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test runner: adding some tests that were missing for the $ constructor.
parent
e6fccd71
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
core.js
test/unit/core.js
+10
-1
No files found.
test/unit/core.js
View file @
6fc2c675
...
...
@@ -12,7 +12,7 @@ test("Basic requirements", function() {
});
test
(
"$()"
,
function
()
{
expect
(
4
);
expect
(
8
);
var
main
=
$
(
"#main"
);
isSet
(
$
(
"div p"
,
main
).
get
(),
q
(
"sndp"
,
"en"
,
"sap"
),
"Basic selector with jQuery object as context"
);
...
...
@@ -41,6 +41,15 @@ test("$()", function() {
equals
(
img
.
length
,
1
,
"Correct number of elements generated for img"
);
var
div
=
$
(
"<div/><hr/><code/><b/>"
);
equals
(
div
.
length
,
4
,
"Correct number of elements generated for div hr code b"
);
// can actually yield more than one, when iframes are included, the window is an array as well
equals
(
$
(
window
).
length
,
1
,
"Correct number of elements generated for window"
);
equals
(
$
(
document
).
length
,
1
,
"Correct number of elements generated for document"
);
equals
(
$
([
1
,
2
,
3
]).
get
(
1
),
2
,
"Test passing an array to the factory"
);
equals
(
$
(
document
.
body
).
get
(
0
),
$
(
'body'
).
get
(
0
),
"Test passing an html node to the factory"
);
});
test
(
"browser"
,
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