Skip to content

Commit

Permalink
test: use instanceof (#1039)
Browse files Browse the repository at this point in the history
  • Loading branch information
KazuCocoa authored Jan 9, 2025
1 parent 105bb75 commit 61ad76a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions test/functional/commands/clipboard-e2e-specs.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { initSession, deleteSession, MOCHA_TIMEOUT } from '../helpers/session';
import { APIDEMO_CAPS } from '../desired';
import { AssertionError } from 'assert';


describe('clipboard', function () {
Expand Down Expand Up @@ -27,9 +28,13 @@ describe('clipboard', function () {
const text = await driver.getClipboard('PLAINTEXT');
try {
text.should.eql('SGVsbG8=');
} catch (AssertionError) { // eslint-disable-line @typescript-eslint/no-unused-vars
// API level 23 and 25 emulator has '\n'
text.should.eql('SGVsbG8=\n');
} catch (e) {
if (e instanceof AssertionError) {
// API level 23 and 25 emulator has '\n'
text.should.eql('SGVsbG8=\n');
} else {
throw e;
}
}
(Buffer.from(text, 'base64').toString()).should.eql('Hello');
});
Expand Down

0 comments on commit 61ad76a

Please sign in to comment.