Skip to content

Commit

Permalink
chore: fix mocha junit reporter when running mocha <6 (#29481)
Browse files Browse the repository at this point in the history
* chore: fix mocha junit reporter when running mocha <6

* Update cli/test/lib/util_spec.js
  • Loading branch information
ryanthemanuel authored May 7, 2024
1 parent 66dac23 commit d875569
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
4 changes: 0 additions & 4 deletions cli/test/lib/tasks/download_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -488,10 +488,6 @@ describe('lib/tasks/download', function () {
})

context('architecture detection', () => {
beforeEach(() => {
sinon.stub(os, 'arch')
})

context('Apple Silicon/M1', () => {
function nockDarwinArm64 () {
return nock('https://download.cypress.io')
Expand Down
3 changes: 3 additions & 0 deletions cli/test/spec_helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,11 @@ sinon.stub = function (obj, method) {

beforeEach(function () {
sinon.stub(os, 'platform')
sinon.stub(os, 'arch')
sinon.stub(os, 'release')
sinon.stub(util, 'getOsVersionAsync').resolves('Foo-OsVersion')

os.arch.returns('x64')
})

afterEach(function () {
Expand Down
13 changes: 13 additions & 0 deletions patches/mocha-junit-reporter+2.2.0.dev.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/node_modules/mocha-junit-reporter/index.js b/node_modules/mocha-junit-reporter/index.js
index fbbed2e..de27092 100644
--- a/node_modules/mocha-junit-reporter/index.js
+++ b/node_modules/mocha-junit-reporter/index.js
@@ -366,7 +366,7 @@ MochaJUnitReporter.prototype.getTestcaseData = function(test, err) {
message = '';
}
var failureMessage = err.stack || message;
- if (!Base.hideDiff && err.expected !== undefined) {
+ if (!Base.hideDiff && err.expected !== undefined && mocha6plus) {
var oldUseColors = Base.useColors;
Base.useColors = false;
failureMessage += "\n" + Base.generateDiff(err.actual, err.expected);

5 comments on commit d875569

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on d875569 May 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.9.0/linux-x64/develop-d8755693d7bff8cf3b4f1a312a18f0fae65211a1/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on d875569 May 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux arm64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.9.0/linux-arm64/develop-d8755693d7bff8cf3b4f1a312a18f0fae65211a1/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on d875569 May 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin arm64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.9.0/darwin-arm64/develop-d8755693d7bff8cf3b4f1a312a18f0fae65211a1/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on d875569 May 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.9.0/darwin-x64/develop-d8755693d7bff8cf3b4f1a312a18f0fae65211a1/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on d875569 May 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the win32 x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.9.0/win32-x64/develop-d8755693d7bff8cf3b4f1a312a18f0fae65211a1/cypress.tgz

Please sign in to comment.