Skip to content

Commit

Permalink
chore: Bump chai and chai-as-promised (#303)
Browse files Browse the repository at this point in the history
  • Loading branch information
mykola-mokhnach authored Jun 23, 2024
1 parent 007f04f commit e4090eb
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 36 deletions.
8 changes: 2 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,12 @@
"@semantic-release/changelog": "^6.0.1",
"@semantic-release/git": "^10.0.1",
"@types/bluebird": "^3.5.38",
"@types/chai": "^4.3.5",
"@types/chai-as-promised": "^7.1.5",
"@types/lodash": "^4.14.196",
"@types/mocha": "^10.0.1",
"@types/node": "^20.4.7",
"@types/sinon": "^17.0.0",
"@types/sinon-chai": "^3.2.9",
"@types/teen_process": "^2.0.2",
"chai": "^4.1.2",
"chai-as-promised": "^7.1.1",
"chai": "^5.1.1",
"chai-as-promised": "^8.0.0",
"conventional-changelog-conventionalcommits": "^7.0.1",
"mocha": "^10.0.0",
"semantic-release": "^23.0.0",
Expand Down
15 changes: 10 additions & 5 deletions test/functional/basic-e2e-specs.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import _ from 'lodash';
import { remote } from 'webdriverio';
import chaiAsPromised from 'chai-as-promised';
import chai from 'chai';
import { HOST, PORT, MOCHA_TIMEOUT, TEXT_EDIT_BUNDLE_ID } from '../utils';

chai.should();
chai.use(chaiAsPromised);

const CAPS = {
platformName: 'mac',
'appium:automationName': 'mac2',
Expand All @@ -17,6 +12,16 @@ describe('Mac2Driver - basic', function () {
this.timeout(MOCHA_TIMEOUT);

let driver;
let chai;

before(async function () {
chai = await import('chai');
const chaiAsPromised = await import('chai-as-promised');

chai.should();
chai.use(chaiAsPromised.default);
});

beforeEach(async function () {
driver = await remote({
hostname: HOST,
Expand Down
15 changes: 10 additions & 5 deletions test/functional/caps-e2e-specs.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
import { remote } from 'webdriverio';
import chaiAsPromised from 'chai-as-promised';
import chai from 'chai';
import os from 'os';
import path from 'path';
import { fs } from 'appium/support';
import { HOST, PORT, MOCHA_TIMEOUT, TEXT_EDIT_BUNDLE_ID } from '../utils';

chai.should();
chai.use(chaiAsPromised);

const TEST_FILE = path.resolve(os.tmpdir(), 'test.test');

const CAPS = {
Expand All @@ -23,6 +18,16 @@ describe('Mac2Driver - caps', function () {
this.timeout(MOCHA_TIMEOUT);

let driver;
let chai;

before(async function () {
chai = await import('chai');
const chaiAsPromised = await import('chai-as-promised');

chai.should();
chai.use(chaiAsPromised.default);
});

beforeEach(async function () {
driver = await remote({
hostname: HOST,
Expand Down
15 changes: 10 additions & 5 deletions test/functional/find-e2e-specs.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import _ from 'lodash';
import { remote } from 'webdriverio';
import chaiAsPromised from 'chai-as-promised';
import chai from 'chai';
import { HOST, PORT, MOCHA_TIMEOUT, TEXT_EDIT_BUNDLE_ID } from '../utils';

chai.should();
chai.use(chaiAsPromised);

const CAPS = {
platformName: 'mac',
'appium:automationName': 'mac2',
Expand All @@ -17,6 +12,16 @@ describe('Mac2Driver - find elements', function () {
this.timeout(MOCHA_TIMEOUT);

let driver;
let chai;

before(async function () {
chai = await import('chai');
const chaiAsPromised = await import('chai-as-promised');

chai.should();
chai.use(chaiAsPromised.default);
});

beforeEach(async function () {
driver = await remote({
hostname: HOST,
Expand Down
15 changes: 10 additions & 5 deletions test/functional/interaction-e2e-specs.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import _ from 'lodash';
import { remote } from 'webdriverio';
import chaiAsPromised from 'chai-as-promised';
import chai from 'chai';
import { HOST, PORT, MOCHA_TIMEOUT, TEXT_EDIT_BUNDLE_ID } from '../utils';

chai.should();
chai.use(chaiAsPromised);

const CAPS = {
platformName: 'mac',
'appium:automationName': 'mac2',
Expand All @@ -18,6 +13,16 @@ describe('Mac2Driver - elements interaction', function () {
this.timeout(MOCHA_TIMEOUT);

let driver;
let chai;

before(async function () {
chai = await import('chai');
const chaiAsPromised = await import('chai-as-promised');

chai.should();
chai.use(chaiAsPromised.default);
});

beforeEach(async function () {
driver = await remote({
hostname: HOST,
Expand Down
10 changes: 8 additions & 2 deletions test/unit/driver-specs.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import Mac2Driver from '../../lib/driver';
import chai from 'chai';
const should = chai.should();

describe('Mac2Driver', function () {
let chai;
let should;

before(async function () {
chai = await import('chai');
should = chai.should();
});

it('should exist', function () {
should.exist(Mac2Driver);
});
Expand Down
14 changes: 10 additions & 4 deletions test/unit/utils-specs.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import sinon from 'sinon';
import * as teen_process from 'teen_process';
import { listChildrenProcessIds } from '../../lib/utils';

const sandbox = sinon.createSandbox();
chai.should();
chai.use(chaiAsPromised);

describe('listChildrenProcessIds', function () {
let chai;

before(async function () {
chai = await import('chai');
const chaiAsPromised = await import('chai-as-promised');

chai.should();
chai.use(chaiAsPromised.default);
});

const EXAMPLE_PS_OUTPUT = `
USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND PPID
_coreaudiod 236 3.1 0.0 4343236 4124 ?? Ss Thu10AM 42:23.82 /usr/sbin/coreau 1
Expand Down
14 changes: 10 additions & 4 deletions test/unit/wda-mac-specs.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import WDA_MAC_SERVER from '../../lib/wda-mac';

chai.use(chaiAsPromised);

describe('WDAMacServer', function () {
let chai;

before(async function () {
chai = await import('chai');
const chaiAsPromised = await import('chai-as-promised');

chai.should();
chai.use(chaiAsPromised.default);
});

describe('parseProxyProperties', function () {
it('should default', function () {
WDA_MAC_SERVER.parseProxyProperties({}).should.eql(
Expand Down

0 comments on commit e4090eb

Please sign in to comment.