Skip to content

Commit

Permalink
chore: Bump chai and chai-as-promised (#130)
Browse files Browse the repository at this point in the history
  • Loading branch information
mykola-mokhnach authored Jun 19, 2024
1 parent 89c5e13 commit e7580bd
Show file tree
Hide file tree
Showing 10 changed files with 65 additions and 55 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ jobs:
prepare_matrix:
runs-on: ubuntu-latest
outputs:
versions: ${{ steps.generate-matrix.outputs.versions }}
versions: ${{ steps.generate-matrix.outputs.active }}
steps:
- name: Select 3 most recent LTS versions of Node.js
- name: Select all active LTS versions of Node.js
id: generate-matrix
run: echo "versions=$(curl -s https://endoflife.date/api/nodejs.json | jq -c '[[.[] | select(.lts != false)][:3] | .[].cycle | tonumber]')" >> "$GITHUB_OUTPUT"
uses: msimerson/node-lts-versions@v1

test:
needs:
Expand Down
8 changes: 2 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,13 @@
"@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.1",
"axios": "^1.x",
"chai": "^4.1.2",
"chai-as-promised": "^7.1.1",
"chai": "^5.1.1",
"chai-as-promised": "^8.0.0",
"conventional-changelog-conventionalcommits": "^8.0.0",
"mocha": "^10.0.0",
"node-simctl": "^7.0.1",
Expand Down
13 changes: 7 additions & 6 deletions test/functional/accessibility-commands-e2e-specs.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
import _ from 'lodash';
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import { retryInterval } from 'asyncbox';
import {
prepareDevice, deleteDevice, ONLINE_TIMEOUT_MS
} from '../helpers/device-helpers';
import IDB from '../../lib/idb';


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

describe('idb accessibility commands', function () {
let idb;
let simctl;
let chai;

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

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

simctl = await prepareDevice();
idb = new IDB({
udid: simctl.udid,
Expand Down
13 changes: 7 additions & 6 deletions test/functional/app-commands-e2e-specs.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
import _ from 'lodash';
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import {
prepareDevice, deleteDevice, ONLINE_TIMEOUT_MS
} from '../helpers/device-helpers';
import IDB from '../../lib/idb';
import { waitForCondition } from 'asyncbox';


const MAPS_BUNDLE_ID = 'com.apple.Maps';

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

describe('idb app commands', function () {
let idb;
let simctl;
let chai;

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

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

simctl = await prepareDevice();
idb = new IDB({
udid: simctl.udid,
Expand Down
13 changes: 7 additions & 6 deletions test/functional/crashlog-commands-e2e-specs.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
import _ from 'lodash';
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import {
prepareDevice, deleteDevice, ONLINE_TIMEOUT_MS
} from '../helpers/device-helpers';
import IDB from '../../lib/idb';


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

describe('idb crashlog commands', function () {
let idb;
let simctl;
let chai;

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

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

simctl = await prepareDevice();
idb = new IDB({
udid: simctl.udid,
Expand Down
13 changes: 8 additions & 5 deletions test/functional/idb-e2e-specs.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import {prepareDevice, deleteDevice, ONLINE_TIMEOUT_MS} from '../helpers/device-helpers';
import IDB from '../../lib/idb';

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

async function assertDeviceDescription(idb, udid) {
const info = await idb.describeDevice();
info.udid.should.eql(udid);
}

describe('idb general', function () {
let simctl;
let chai;
let should;

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

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

simctl = await prepareDevice({
prebooted: false,
});
Expand Down
13 changes: 7 additions & 6 deletions test/functional/interaction-commands-e2e-specs.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import {
prepareDevice, deleteDevice, ONLINE_TIMEOUT_MS
} from '../helpers/device-helpers';
import IDB from '../../lib/idb';


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

describe('idb interaction commands', function () {
let simctl;
let idb;
let chai;

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

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

simctl = await prepareDevice();
idb = new IDB({
udid: simctl.udid,
Expand Down
13 changes: 7 additions & 6 deletions test/functional/misc-commands-e2e-specs.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import {
prepareDevice, deleteDevice, ONLINE_TIMEOUT_MS
} from '../helpers/device-helpers';
import IDB from '../../lib/idb';


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

describe('idb misc commands', function () {
let simctl;
let idb;
let chai;

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

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

simctl = await prepareDevice();
idb = new IDB({
udid: simctl.udid,
Expand Down
13 changes: 7 additions & 6 deletions test/functional/xctest-commands-e2e-specs.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
import chai from 'chai';
import path from 'path';
import chaiAsPromised from 'chai-as-promised';
import axios from 'axios';
import {
prepareDevice, deleteDevice, ONLINE_TIMEOUT_MS
} from '../helpers/device-helpers';
import IDB from '../../lib/idb';
import { retryInterval } from 'asyncbox';


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

const WDA_BUNDLE_ID = 'com.facebook.WebDriverAgentRunner.xctrunner';
const WDA_BUNDLE_PATH = path.resolve(__dirname, '..', 'asset', 'WebDriverAgentRunner-Runner.app');
const XCTEST_BUNDLE_PATH = path.join(WDA_BUNDLE_PATH, 'PlugIns', 'WebDriverAgentRunner.xctest');
Expand All @@ -20,8 +14,15 @@ const SAFARI_BUNDLE_ID = 'com.apple.mobilesafari';
describe('idb xctest commands', function () {
let simctl;
let idb;
let chai;

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

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

simctl = await prepareDevice();
idb = new IDB({
udid: simctl.udid,
Expand Down
15 changes: 10 additions & 5 deletions test/unit/helpers-specs.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import {
fixOutputToArray, convertToIDBEnv
} from '../../lib/helpers';
import _ from 'lodash';

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

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

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

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

describe('fixOutputToArray', function () {
it('should properly fix the valid output', function () {
const result = fixOutputToArray(`
Expand Down

0 comments on commit e7580bd

Please sign in to comment.