Skip to content

Can't pass hash values containing exponential operators to --env command line option. #6891

@tzolnai

Description

@tzolnai

Current behavior:

We use --env variable to pass some environment variables to cypress, when it's running both in headless and headed mode.

One of the parameters is a hash (mix of numbers and characters). Surprisingly some specific hash values make cypress to fail reading this value from the command line (e.g. 769e98018). The corresponding environment variable is not set and the Cypress.env() function returns with null.

Desired behavior:

It should not be a problem to read a hash from the command line and put into an environment variable.

Test code to reproduce

A simplified command line call:

node_modules/cypress/bin/cypress open --env WSD_VERSION_HASH=769e98018

Test code showing the issue:

describe('Hash test.', function() {
    it('Test 1.', function() {
        expect(Cypress.env('WSD_VERSION_HASH')).to.equal('769e98018');
    });
});

This test fails with: 'expected null to equal 769e98018'

If I remove the 'e' character for example, then the value is read correctly.

Versions

Cypress 4.1.0
OpenSUSE 15.1 and Ubuntu 18.04

Metadata

Metadata

Labels

good first issueGood for newcomerspkg/serverThis is due to an issue in the packages/server directorytype: bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions