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 #249

Merged
merged 1 commit into from
Jun 18, 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
8 changes: 2 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,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.1",
"@types/sinon-chai": "^3.2.9",
"@types/teen_process": "^2.0.2",
"appium-xcode": "^5.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",
"prettier": "^3.0.0",
Expand Down
21 changes: 11 additions & 10 deletions test/e2e/simctl-e2e-specs.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/* global it:true, describe:true*/
// transpile:mocha

import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import _ from 'lodash';
import Simctl from '../../lib/simctl.js';
import xcode from 'appium-xcode';
Expand All @@ -13,22 +8,28 @@ import path from 'path';
import os from 'os';
import fs from 'fs/promises';

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


describe('simctl', function () {
const DEVICE_NAME = process.env.DEVICE_NAME || 'iPhone X';
const MOCHA_TIMEOUT = 200000;
this.timeout(MOCHA_TIMEOUT);

let chai;
let chaiAsPromised;
let expect;
let should;
let randName;
let validSdks = [];
let sdk;
let simctl;

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

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

simctl = new Simctl();
const devices = await simctl.getDevices();
console.log(`Found devices: ${JSON.stringify(devices, null, 2)}`); // eslint-disable-line no-console
Expand Down
16 changes: 11 additions & 5 deletions test/unit/simctl-specs.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import chai from 'chai';
import pq from 'proxyquire';
import chaiAsPromised from 'chai-as-promised';
import sinon from 'sinon';
import * as TeenProcess from 'teen_process';
import _ from 'lodash';
Expand All @@ -25,10 +23,10 @@ const devicePayloads = [
],
];

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

describe('simctl', function () {
let chai;
let chaiAsPromised;

const execStub = sinon.stub(TeenProcess, 'exec');
function stubSimctl (xcrun = {}) {
const xcrunPath = process.env.XCRUN_BINARY || xcrun.path;
Expand All @@ -39,6 +37,14 @@ describe('simctl', function () {
return new Simctl({ xcrun });
}

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

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

describe('getDevices', function () {
let simctl;

Expand Down
Loading