Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Bump chai and chai-as-promised #115

Merged
merged 1 commit into from
Jun 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -74,21 +74,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.2",
"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
15 changes: 10 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: 'MozillaFirefox',
platformName: 'linux',
Expand All @@ -17,6 +12,16 @@ describe('Desktop Gecko Driver', function () {

/** @type {import('webdriverio').Browser} */
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: 9 additions & 6 deletions test/functional/mobile-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 DEVICE_NAME = process.env.DEVICE_NAME || 'emulator-5554';
// The Firefox binary could be retrieved from https://www.mozilla.org/en-GB/firefox/all/#product-android-release
const CAPS = {
Expand All @@ -24,7 +19,15 @@ describe('Mobile GeckoDriver', function () {
this.timeout(MOCHA_TIMEOUT);

let driver;
before(function () {
let chai;

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

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

if (process.env.CI) {
// Figure out a way to run this on Azure
return this.skip();
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 GeckoDriver from '../../lib/driver';
import chai from 'chai';
const should = chai.should();

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

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

it('should exist', function () {
should.exist(GeckoDriver);
});
Expand Down
9 changes: 7 additions & 2 deletions test/unit/utils-specs.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
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
Loading