Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
rsvp.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
rsvp.js
Commits
8ac85d1c
Commit
8ac85d1c
authored
Jan 11, 2013
by
tomhuda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up browser build
parent
fabe22cb
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
11040 additions
and
63 deletions
+11040
-63
Rakefile
Rakefile
+14
-1
tests/index.html
tests/index.html
+4
-27
tests/rsvp.js
tests/rsvp.js
+1
-0
tests/test-adapter.js
tests/test-adapter.js
+38
-35
tests/tmp/test-bundle.js
tests/tmp/test-bundle.js
+10983
-0
tests/vendor/assert.js
tests/vendor/assert.js
+0
-0
tests/vendor/mocha.css
tests/vendor/mocha.css
+0
-0
tests/vendor/mocha.js
tests/vendor/mocha.js
+0
-0
No files found.
Rakefile
View file @
8ac85d1c
...
@@ -52,6 +52,16 @@ end
...
@@ -52,6 +52,16 @@ end
task
:dist
=>
[
"browser/rsvp.js"
,
"browser/rsvp.min.js"
,
"browser/rsvp.amd.js"
,
"node/rsvp.js"
]
task
:dist
=>
[
"browser/rsvp.js"
,
"browser/rsvp.min.js"
,
"browser/rsvp.amd.js"
,
"node/rsvp.js"
]
directory
"tests/tmp"
test_files
=
[
"tests/test-adapter.js"
]
test_files
+=
Dir
[
"promises-tests/lib/tests/**/*.js"
]
test_files
+=
Dir
[
"promises-tests/node_modules/sinon/lib/{sinon.js,sinon/*.js}"
]
file
"tests/tmp/test-bundle.js"
=>
[
"tests/tmp"
].
concat
(
test_files
)
do
sh
"browserify
#{
test_files
.
join
(
" "
)
}
> tests/tmp/test-bundle.js"
end
task
:push
=>
:dist
do
task
:push
=>
:dist
do
sh
"git add browser/rsvp.js browser/rsvp.min.js browser/rsvp.amd.js"
sh
"git add browser/rsvp.js browser/rsvp.min.js browser/rsvp.amd.js"
sh
"git commit -m 'Updates build artifacts'"
sh
"git commit -m 'Updates build artifacts'"
...
@@ -68,14 +78,17 @@ task :update_tests => "promises-tests" do
...
@@ -68,14 +78,17 @@ task :update_tests => "promises-tests" do
end
end
end
end
desc
"Run the tests using Node"
task
:test
=>
[
:update_tests
,
"tests/rsvp.js"
]
do
task
:test
=>
[
:update_tests
,
"tests/rsvp.js"
]
do
cd
"promises-tests"
do
cd
"promises-tests"
do
sh
"node ./lib/cli.js ../tests/test-adapter.js"
sh
"node ./lib/cli.js ../tests/test-adapter.js"
end
end
end
end
task
:browser_test
=>
[
:update_tests
,
:dist
]
do
desc
"Run the tests using the browser"
task
:browser_test
=>
[
:update_tests
,
"tests/tmp/test-bundle.js"
,
:dist
]
do
sh
"open tests/index.html"
sh
"open tests/index.html"
end
end
desc
"Build RSVP.js"
task
:default
=>
:dist
task
:default
=>
:dist
tests/index.html
View file @
8ac85d1c
...
@@ -2,39 +2,16 @@
...
@@ -2,39 +2,16 @@
<head>
<head>
<meta
charset=
"utf-8"
>
<meta
charset=
"utf-8"
>
<title>
rsvp.js Tests
</title>
<title>
rsvp.js Tests
</title>
<link
rel=
"stylesheet"
href=
"mocha.css"
/>
<link
rel=
"stylesheet"
href=
"
vendor/
mocha.css"
/>
</head>
</head>
<body>
<body>
<div
id=
"mocha"
></div>
<div
id=
"mocha"
></div>
<script>
var
require
=
function
(
name
)
{
switch
(
name
)
{
case
"
assert
"
:
return
window
.
assert
;
case
"
sinon
"
:
return
window
.
sinon
;
case
"
./helpers/testThreeCases
"
:
return
window
.
testThreeCases
;
case
"
./rsvp
"
:
return
RSVP
;
}
};
</script>
<script
src=
"assert.js"
></script>
<script
src=
"sinon.js"
></script>
<script
src=
"mocha.js"
></script>
<script
src=
"../browser/rsvp.js"
></script>
<script
src=
"../browser/rsvp.js"
></script>
<script
src=
"test-adapter.js"
></script>
<script
src=
"vendor/assert.js"
></script>
<script>
<script
src=
"vendor/mocha.js"
></script>
var
global
=
window
;
var
exports
=
testThreeCases
=
{};
</script>
<script
src=
"../promises-tests/lib/tests/helpers/testThreeCases.js"
></script>
<script>
window
.
exports
=
undefined
;
</script>
<script>
mocha
.
setup
({
ui
:
'
bdd
'
,
timeout
:
200
})
</script>
<script>
mocha
.
setup
({
ui
:
'
bdd
'
,
timeout
:
200
})
</script>
<script
src=
"tmp/test-bundle.js"
></script>
<script
src=
"extension-tests.js"
></script>
<script
src=
"extension-tests.js"
></script>
<script
src=
"../promises-tests/lib/tests/3.2.1.js"
></script>
<script
src=
"../promises-tests/lib/tests/3.2.2.js"
></script>
<script
src=
"../promises-tests/lib/tests/3.2.3.js"
></script>
<script
src=
"../promises-tests/lib/tests/3.2.4.js"
></script>
<script
src=
"../promises-tests/lib/tests/3.2.5.js"
></script>
<script
src=
"../promises-tests/lib/tests/3.2.6.js"
></script>
<script>
<script>
mocha
.
run
();
mocha
.
run
();
</script>
</script>
...
...
tests/rsvp.js
View file @
8ac85d1c
...
@@ -283,4 +283,5 @@ function configure(name, value) {
...
@@ -283,4 +283,5 @@ function configure(name, value) {
exports
.
Promise
=
Promise
;
exports
.
Promise
=
Promise
;
exports
.
Event
=
Event
;
exports
.
Event
=
Event
;
exports
.
EventTarget
=
EventTarget
;
exports
.
EventTarget
=
EventTarget
;
exports
.
all
=
all
;
exports
.
configure
=
configure
;
exports
.
configure
=
configure
;
tests/test-adapter.js
View file @
8ac85d1c
/*global RSVP*/
/*global RSVP*/
(
function
(
global
)
{
'
use strict
'
;
'
use strict
'
;
var
Promise
=
require
(
'
./rsvp
'
).
Promise
;
var
adapter
;
if
(
typeof
process
!==
'
undefined
'
&&
{}.
toString
.
call
(
process
)
===
'
[object process]
'
)
{
adapter
=
exports
;
}
else
{
global
.
adapter
=
adapter
=
{};
}
adapter
.
fulfilled
=
function
(
value
)
{
var
promise
=
new
Promise
();
promise
.
resolve
(
value
);
return
promise
;
};
adapter
.
rejected
=
function
(
error
)
{
var
Promise
;
var
promise
=
new
Promise
();
promise
.
reject
(
error
);
if
(
typeof
RSVP
!==
'
undefined
'
)
{
return
promise
;
// Test the browser build
};
Promise
=
RSVP
.
Promise
;
}
else
{
// Test the Node build
var
Promise
=
require
(
'
../node/rsvp
'
).
Promise
;
}
var
adapter
=
{};
adapter
.
pending
=
function
()
{
adapter
.
fulfilled
=
function
(
value
)
{
var
promise
=
new
Promise
();
var
promise
=
new
Promise
();
promise
.
resolve
(
value
);
return
{
return
promise
;
promise
:
promise
,
};
fulfill
:
function
(
value
)
{
promise
.
resolve
(
value
);
adapter
.
rejected
=
function
(
error
)
{
},
var
promise
=
new
Promise
();
reject
:
function
(
error
)
{
promise
.
reject
(
error
);
promise
.
reject
(
error
);
return
promise
;
}
};
};
adapter
.
pending
=
function
()
{
var
promise
=
new
Promise
();
return
{
promise
:
promise
,
fulfill
:
function
(
value
)
{
promise
.
resolve
(
value
);
},
reject
:
function
(
error
)
{
promise
.
reject
(
error
);
}
};
};
})(
this
);
};
module
.
exports
=
global
.
adapter
=
adapter
;
tests/
sinon
.js
→
tests/
tmp/test-bundle
.js
View file @
8ac85d1c
This diff is collapsed.
Click to expand it.
tests/assert.js
→
tests/
vendor/
assert.js
View file @
8ac85d1c
File moved
tests/mocha.css
→
tests/
vendor/
mocha.css
View file @
8ac85d1c
File moved
tests/mocha.js
→
tests/
vendor/
mocha.js
View file @
8ac85d1c
File moved
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