Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
This commit is contained in:
parent
93e3a48004
commit
b38dea0597
25901 changed files with 9982925 additions and 369 deletions
33
gaia/apps/system/test/unit/promise_test.js
Executable file
33
gaia/apps/system/test/unit/promise_test.js
Executable file
|
|
@ -0,0 +1,33 @@
|
|||
/** global*/
|
||||
'use strict';
|
||||
|
||||
suite('Promise', function() {
|
||||
var subject;
|
||||
setup(function() {
|
||||
subject = {};
|
||||
subject.promiseMethod = function() {
|
||||
return Promise.resolve();
|
||||
};
|
||||
subject.promiseFirstFunctionErrorMethod = function() {
|
||||
return new Promise((resolve) => {
|
||||
throw new Error('This is an error.');
|
||||
});
|
||||
};
|
||||
subject.promiseThenFunctionErrorMethod = function() {
|
||||
return Promise.resolve().then(() => {
|
||||
throw new Error('This is an error.');
|
||||
});
|
||||
};
|
||||
});
|
||||
test('what if error in the first method', function(done) {
|
||||
subject.promiseFirstFunctionErrorMethod().catch((err) => {
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
test('what if error in the then method', function(done) {
|
||||
subject.promiseThenFunctionErrorMethod().catch((err) => {
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
Loading…
Reference in a new issue