Skip to content

Commit

Permalink
chore: Bump chai and chai-as-promised (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
mykola-mokhnach authored Jun 23, 2024
1 parent 5596be3 commit da4d9de
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 25 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,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
9 changes: 2 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,16 @@
"@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.0",
"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",
"rimraf": "^5.0.0",
"semantic-release": "^24.0.0",
"sinon": "^18.0.0",
"ts-node": "^10.9.1",
"typescript": "^5.4.2",
"webdriverio": "^8.0.5"
Expand Down
14 changes: 9 additions & 5 deletions test/functional/desktop-driver-e2e-specs.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import { remote } from 'webdriverio';
import chaiAsPromised from 'chai-as-promised';
import chai from 'chai';
import { HOST, PORT, MOCHA_TIMEOUT } from '../utils';

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


const CAPS = {
browserName: 'AppiumSafari',
Expand All @@ -15,6 +10,15 @@ const CAPS = {

describe('Desktop SafariDriver', function () {
this.timeout(MOCHA_TIMEOUT);
let chai;

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

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

/** @type {import('webdriverio').Browser} */
let driver;
Expand Down
12 changes: 7 additions & 5 deletions test/functional/mobile-driver-e2e-specs.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import { remote } from 'webdriverio';
import chaiAsPromised from 'chai-as-promised';
import chai from 'chai';
import Simctl from 'node-simctl';
import { HOST, PORT, MOCHA_TIMEOUT } from '../utils';

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

const PLATFORM_VERSION = process.env.PLATFORM_VERSION || '14.1';
const DEVICE_NAME = process.env.DEVICE_NAME || 'iPhone 11 Pro Max';
const CAPS = {
Expand All @@ -20,10 +15,17 @@ const CAPS = {

describe('Mobile SafariDriver', function () {
this.timeout(MOCHA_TIMEOUT);
let chai;

/** @type {import('webdriverio').Browser} */
let driver;
before(async function () {
chai = await import('chai');
const chaiAsPromised = await import('chai-as-promised');

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

if (process.env.CI) {
// In Azure CI the stuff unexpectedly fails with
// "The device is not configured to allow remote control via WebDriver. To fix this, toggle 'Allow Remote Automation' in Safari's settings (Settings App > Safari > Advanced)."
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 SafariDriver from '../../lib/driver';
import chai from 'chai';
const should = chai.should();

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

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

it('should exist', function () {
should.exist(SafariDriver);
});
Expand Down
10 changes: 7 additions & 3 deletions test/unit/utils-specs.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import { formatCapsForServer } from '../../lib/utils';
import chai from 'chai';

chai.should();

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

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

it('should format empty caps', function () {
const result = formatCapsForServer({});
result.should.eql({
Expand Down

0 comments on commit da4d9de

Please sign in to comment.