Skip to content

Commit

Permalink
fix(deps): update dependency ansi_up to version .x 馃専 (#4331)
Browse files Browse the repository at this point in the history
* fix(deps): update ansi_up to 4.0.3 馃専

* Update ansi_up to use new non-deprecated 2.0+ api

* Do not pass 'use_classes: true' (defaults to false) - we are expecting rgb values in our tests

* set back to use_classes

* Fix 'use_classes' option which was being incorrectly passed

Co-authored-by: Renovate Bot <renovatebot@gmail.com>
Co-authored-by: Jennifer Shehane <shehane.jennifer@gmail.com>
  • Loading branch information
3 people committed Dec 20, 2019
1 parent 14206e3 commit c3ad1a3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
15 changes: 8 additions & 7 deletions packages/server/lib/errors.coffee
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
_ = require("lodash")
strip = require("strip-ansi")
chalk = require("chalk")
ansi_up = require("ansi_up")
_ = require("lodash")
strip = require("strip-ansi")
chalk = require("chalk")
AU = require('ansi_up')
Promise = require("bluebird")

ansi_up = new AU.default
ansi_up.use_classes = true

twoOrMoreNewLinesRe = /\n{2,}/

isProduction = ->
Expand Down Expand Up @@ -913,9 +916,7 @@ clone = (err, options = {}) ->
obj = _.pick(err, "type", "name", "stack", "fileName", "lineNumber", "columnNumber")

if options.html
obj.message = ansi_up.ansi_to_html(err.message, {
use_classes: true
})
obj.message = ansi_up.ansi_to_html(err.message)
else
obj.message = err.message

Expand Down
3 changes: 2 additions & 1 deletion packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@
"@cypress/commit-info": "2.2.0",
"@cypress/get-windows-proxy": "1.6.0",
"@cypress/icons": "0.7.0",
"@cypress/mocha-teamcity-reporter": "1.0.0",
"@ffmpeg-installer/ffmpeg": "1.0.19",
"ansi_up": "1.3.0",
"ansi_up": "4.0.3",
"black-hole-stream": "0.0.1",
"bluebird": "3.7.0",
"browserify": "16.3.0",
Expand Down
7 changes: 6 additions & 1 deletion packages/server/test/unit/errors_spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,16 @@ describe "lib/errors", ->
expect(ret).to.be.undefined

context ".clone", ->
it "converts err.message from ansi to html with span classes", ->
it "converts err.message from ansi to html with span classes when html true", ->
err = new Error("foo" + chalk.blue("bar") + chalk.yellow("baz"))
obj = errors.clone(err, {html: true})
expect(obj.message).to.eq('foo<span class="ansi-blue-fg">bar</span><span class="ansi-yellow-fg">baz</span>')

it "does not convert err.message from ansi to html when no html option", ->
err = new Error("foo" + chalk.blue("bar") + chalk.yellow("baz"))
obj = errors.clone(err)
expect(obj.message).to.eq('foo\u001b[34mbar\u001b[39m\u001b[33mbaz\u001b[39m')

context ".displayFlags", ->
it "returns string formatted from selected keys", ->
options = {
Expand Down

4 comments on commit c3ad1a3

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on c3ad1a3 Dec 20, 2019

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.

You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.

You will need to use custom CYPRESS_INSTALL_BINARY url and install Cypress using an url instead of the version.

export CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/3.8.1/linux-x64/circle-develop-c3ad1a372a0a50f1e8df5f170433418db6bd3b3a-220932/cypress.zip
npm install https://cdn.cypress.io/beta/npm/3.8.1/circle-develop-c3ad1a372a0a50f1e8df5f170433418db6bd3b3a-220938/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on c3ad1a3 Dec 20, 2019

Choose a reason for hiding this comment

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

AppVeyor has built the win32 ia32 version of the Test Runner.

You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.

You will need to use custom CYPRESS_INSTALL_BINARY url and install Cypress using an url instead of the version.

set CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/3.8.1/win32-ia32/appveyor-develop-c3ad1a372a0a50f1e8df5f170433418db6bd3b3a-29677663/cypress.zip
npm install https://cdn.cypress.io/beta/binary/3.8.1/win32-ia32/appveyor-develop-c3ad1a372a0a50f1e8df5f170433418db6bd3b3a-29677663/cypress.zip

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on c3ad1a3 Dec 20, 2019

Choose a reason for hiding this comment

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

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

You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.

You will need to use custom CYPRESS_INSTALL_BINARY url and install Cypress using an url instead of the version.

set CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/3.8.1/win32-x64/appveyor-develop-c3ad1a372a0a50f1e8df5f170433418db6bd3b3a-29677663/cypress.zip
npm install https://cdn.cypress.io/beta/binary/3.8.1/win32-x64/appveyor-develop-c3ad1a372a0a50f1e8df5f170433418db6bd3b3a-29677663/cypress.zip

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on c3ad1a3 Dec 20, 2019

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.

You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.

You will need to use custom CYPRESS_INSTALL_BINARY url and install Cypress using an url instead of the version.

export CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/3.8.1/darwin-x64/circle-develop-c3ad1a372a0a50f1e8df5f170433418db6bd3b3a-220949/cypress.zip
npm install https://cdn.cypress.io/beta/npm/3.8.1/circle-develop-c3ad1a372a0a50f1e8df5f170433418db6bd3b3a-220946/cypress.tgz

Please sign in to comment.