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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Romain Courteaud
rsvp.js
Commits
df1d9ba7
Commit
df1d9ba7
authored
Oct 17, 2012
by
Yehuda Katz
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #13 from domenic/promise-tests
Use promise-tests 2.0.0 release to get rid of crazy Rakefile-fu.
parents
3c4b86aa
af1dc701
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
6 additions
and
52 deletions
+6
-52
.gitignore
.gitignore
+0
-1
.npmignore
.npmignore
+0
-1
Rakefile
Rakefile
+2
-45
package.json
package.json
+3
-2
tests/test-adapter.js
tests/test-adapter.js
+1
-3
No files found.
.gitignore
View file @
df1d9ba7
/node_modules
/promise-tests
.npmignore
View file @
df1d9ba7
...
...
@@ -2,6 +2,5 @@
/.npmignore
/browser/
/node_modules/
/promise-tests/
/Rakefile
/tests/
Rakefile
View file @
df1d9ba7
def
replace_adapter
(
filename
)
contents
=
File
.
read
(
filename
)
regex
=
Regexp
.
new
(
"^"
+
Regexp
.
escape
(
%{var adapter = require("./adapters/q");}
)
+
"$"
)
replacement
=
%{var adapter = require("./adapters/rsvp");}
open
(
filename
,
"w"
)
do
|
file
|
file
.
write
contents
.
gsub
(
regex
,
replacement
)
end
end
file
"promise-tests"
do
sh
"git clone https://github.com/domenic/promise-tests.git"
end
task
:update
do
cd
"promise-tests"
do
sh
"git reset --hard origin/master"
sh
"git pull"
sh
"npm install"
end
end
file
"promise-tests/lib/adapters/rsvp.js"
=>
[
"promise-tests"
,
:update
]
do
cp
"tests/test-adapter.js"
,
"promise-tests/lib/adapters/rsvp.js"
end
task
:prepare_tests
=>
"promise-tests/lib/adapters/rsvp.js"
%w(promises-a.js always-async.js resolution-races.js returning-a-promise.js)
.
each
do
|
test
|
file
test
=>
"promise-tests/lib/adapters/rsvp.js"
do
replace_adapter
(
"promise-tests/lib/
#{
test
}
"
)
end
task
:prepare_tests
=>
test
end
task
:test
=>
:prepare_tests
do
cd
"promise-tests"
do
sh
"./node_modules/mocha/bin/mocha lib/promises-a.js lib/always-async.js lib/resolution-races.js lib/returning-a-promise.js --reporter spec"
end
end
directory
"browser"
file
"browser/rsvp.js"
=>
[
"browser"
,
"lib/rsvp.js"
]
do
...
...
@@ -69,7 +26,7 @@ task :dist => ["browser/rsvp.js", "browser/rsvp.min.js", "browser/rsvp-amd.js"]
task
:push
=>
:dist
do
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'"
end
task
:default
=>
[
:browser
,
:test
]
task
:default
=>
[
:browser
]
package.json
View file @
df1d9ba7
...
...
@@ -5,10 +5,11 @@
"main"
:
"lib/rsvp.js"
,
"directories"
:
{
"lib"
:
"lib"
},
"devDependencies"
:
{
"
jshint
"
:
"
~0.9
"
"
jshint
"
:
"
~0.9
"
,
"
promise-tests
"
:
"
2.0.0
"
},
"scripts"
:
{
"test"
:
"
rake
"
,
"test"
:
"
promise-tests all ./tests/test-adapter
"
,
"lint"
:
"jshint lib"
},
"repository"
:
{
...
...
tests/test-adapter.js
View file @
df1d9ba7
"
use strict
"
;
var
Promise
=
require
(
"
../
../../
lib/rsvp
"
).
Promise
;
var
Promise
=
require
(
"
../lib/rsvp
"
).
Promise
;
exports
.
fulfilled
=
function
(
value
)
{
var
promise
=
new
Promise
();
...
...
@@ -27,5 +27,3 @@ exports.pending = function () {
}
};
};
exports
.
throws
=
true
;
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