We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
See the "Current behavior" for bug details.
I already boiled the problem down to an error in the jsonlint module that is used for parsing the JSON data in
cypress/packages/server/lib/fixture.coffee
Line 90 in a888f89
Returning the result of JSON.parse() if no jsonlint error happened will fix the error while still keeping jsonlint as validator.
JSON.parse()
This is a bug.
A JSON file that contains unicode escape sequences (\uXXXX) in string values is not parsed correctly ("\uXXXX" results in "\uXXXX").
JSON fixture is parsed correctly.
See https://github.com/vschoettke/cypress_fixture_parse_bug for an example
fixtures/test_error.json
{ "name": "\u30d0\u30b0" }
integration/test_spec.js
describe("cypress should load json fixture with unicode specifier correctly", () => { it("should decode correctly", () => { cy.server(); cy.fixture("test_error.json").then((data) => { const realData = require("../fixtures/test_error.json"); expect(data.name).to.equal(realData.name); }); }); });
The text was updated successfully, but these errors were encountered:
Might switch to updated fork https://github.com/circlecell/jsonlint-mod or just use JSON.parse
JSON.parse
Sorry, something went wrong.
Yeah, seems it is escaping the slash, so it does not process unicode JSON fixtures correctly.
server: parse JSON with unicode escape, close #964
5a47eb3
f8d8670
Released in 1.1.3.
1.1.3
bahmutov
No branches or pull requests
See the "Current behavior" for bug details.
I already boiled the problem down to an error in the jsonlint module that is used for parsing the JSON data in
cypress/packages/server/lib/fixture.coffee
Line 90 in a888f89
Returning the result of
JSON.parse()
if no jsonlint error happened will fix the error while still keeping jsonlint as validator.Is this a Feature or Bug?
This is a bug.
Current behavior:
A JSON file that contains unicode escape sequences (\uXXXX) in string values is not parsed correctly ("\uXXXX" results in "\uXXXX").
Desired behavior:
JSON fixture is parsed correctly.
How to reproduce:
See https://github.com/vschoettke/cypress_fixture_parse_bug for an example
Test code:
fixtures/test_error.json
integration/test_spec.js
The text was updated successfully, but these errors were encountered: