Skip to content

Commit

Permalink
Fix some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
imurchie committed Feb 23, 2018
1 parent 488cd02 commit 24713ed
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/unit/commands/log-specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,29 @@ describe('commands - logging', function () {
driver.adb = new ADB();
});
describe('getLogTypes', function () {
it('should respond to the command', function () {
driver.getLogTypes.should.an.instanceof(Function);
});
it('should get log types', async function () {
const types = await driver.getLogTypes();
// all the types should be returned
_.xor(['logcat', 'bugreport', 'server'], types).should.eql([]);
});
});
describe('getLog', function () {
it('should respond to the command', function () {
driver.getLog.should.be.an.instanceof(Function);
});
it('should get logcat logs', async function () {
sinon.stub(driver.adb, 'getLogcatLogs').returns(['logs']);
(await driver.getLog('logcat')).should.be.deep.equal(['logs']);
driver.adb.getLogcatLogs.called.should.be.true;
driver.adb.getLogcatLogs.restore();
});
it('should get bugreport logs', async function () {
sinon.stub(driver.adb, 'bugreport').returns(`line1${os.EOL}line2`);
(await driver.getLog('bugreport')).should.be.deep.equal(['line1', 'line2']);
driver.adb.bugreport.called.should.be.true;
driver.adb.bugreport.restore();
});
});
Expand Down

0 comments on commit 24713ed

Please sign in to comment.