mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-06-12 13:31:18 -04:00
Address feedback from review
This commit is contained in:
parent
a73ef6819f
commit
b78bdb4c93
2 changed files with 13 additions and 8 deletions
|
@ -319,7 +319,7 @@ class DeviceManager {
|
|||
json: {}
|
||||
}, (err, res, body) => {
|
||||
if (err) return reject(err);
|
||||
if (res.statusCode !== 200) reject(body);
|
||||
if (res.statusCode !== 200) return reject(body);
|
||||
resolve(body);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -24,11 +24,16 @@ test('list', t => {
|
|||
const deviceManager = new DeviceManager();
|
||||
deviceManager
|
||||
.list('test', 'test', null)
|
||||
.catch(err => {
|
||||
t.true((typeof err === 'undefined') || (typeof err === 'object'));
|
||||
})
|
||||
.then(body => {
|
||||
t.true((typeof body === 'undefined') || (typeof body === 'object'));
|
||||
t.end();
|
||||
});
|
||||
.then(
|
||||
body => {
|
||||
// SDM is running
|
||||
t.type(body, 'object');
|
||||
t.end();
|
||||
},
|
||||
err => {
|
||||
// If SDM is not running error is expected, continue
|
||||
t.true(typeof err === 'object' || typeof err === 'undefined');
|
||||
t.end();
|
||||
}
|
||||
);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue