chore: fast-json-format library upgrade

This commit is contained in:
lohit-bruno
2025-11-10 16:58:14 +05:30
parent ab7ead91d5
commit 408dd6bccf
8 changed files with 29 additions and 23 deletions

8
package-lock.json generated
View File

@@ -14235,9 +14235,9 @@
}
},
"node_modules/fast-json-format": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/fast-json-format/-/fast-json-format-0.2.0.tgz",
"integrity": "sha512-HdcxHsca6fqk7vt7Ak4a8JTWZQt3yEPwXk8hBPKCg8PLgX7DmXEbwgv7vLLiinAQxTcSFNyz5OiWr8m4r/0tKA==",
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/fast-json-format/-/fast-json-format-0.3.0.tgz",
"integrity": "sha512-B95psGYXJ5XItmxLR6JFcQRQafDyfy8ecHiV/jWCJF9oCIA9/o+wt89cGW61D04xf07yCpIaevvCQbgeJ9w8lQ==",
"license": "MIT"
},
"node_modules/fast-json-stable-stringify": {
@@ -26874,7 +26874,7 @@
"dompurify": "^3.2.4",
"escape-html": "^1.0.3",
"fast-fuzzy": "^1.12.0",
"fast-json-format": "~0.2.0",
"fast-json-format": "~0.3.0",
"file": "^0.2.2",
"file-dialog": "^0.0.8",
"file-saver": "^2.0.5",

View File

@@ -28,7 +28,7 @@
"dompurify": "^3.2.4",
"escape-html": "^1.0.3",
"fast-fuzzy": "^1.12.0",
"fast-json-format": "~0.2.0",
"fast-json-format": "~0.3.0",
"file": "^0.2.2",
"file-dialog": "^0.0.8",
"file-saver": "^2.0.5",

View File

@@ -1,6 +1,6 @@
{
"version": "1",
"name": "bigint-test",
"name": "collection",
"type": "collection",
"ignore": [
"node_modules",

View File

@@ -1,5 +1,5 @@
meta {
name: bigint-request
name: request
type: http
seq: 1
}
@@ -12,6 +12,7 @@ post {
body:json {
{
"data": 1736184243098437392
"bigint": 1736184243098437392,
"unicode": ["\u4e00","\u4e8c","\u4e09"]
}
}

View File

@@ -1,7 +1,7 @@
{
"collections": [
{
"path": "{{projectRoot}}/tests/response/json-with-bigint-response-formatting/fixtures/collection",
"path": "{{projectRoot}}/tests/response/json-response-formatting/fixtures/collection",
"securityConfig": {
"jsSandboxMode": "safe"
}

View File

@@ -0,0 +1,6 @@
{
"maximized": false,
"lastOpenedCollections": [
"{{projectRoot}}/tests/response/json-response-formatting/fixtures/collection"
]
}

View File

@@ -1,20 +1,20 @@
import { test, expect } from '../../../playwright';
import { closeAllCollections } from '../../utils/page';
test.describe.serial('JSON Response Formatting with BigInt', () => {
test.describe.serial('JSON Response Formatting', () => {
test.afterAll(async ({ pageWithUserData: page }) => {
// cleanup: close all collections
await closeAllCollections(page);
});
test('should handle BigInt values in JSON response formatting', async ({ pageWithUserData: page }) => {
test('should handle BigInt values and unicode chars in JSON response formatting', async ({ pageWithUserData: page }) => {
await test.step('Navigate to collection and request', async () => {
// Navigate to the test collection
await expect(page.locator('#sidebar-collection-name').getByText('bigint-test')).toBeVisible();
await page.locator('#sidebar-collection-name').getByText('bigint-test').click();
await expect(page.locator('#sidebar-collection-name').getByText('collection')).toBeVisible();
await page.locator('#sidebar-collection-name').getByText('collection').click();
// Navigate to the bigint request
await page.getByRole('complementary').getByText('bigint-request').click();
// Navigate to the request
await page.getByRole('complementary').getByText('request').click();
});
await test.step('Send request and verify response', async () => {
@@ -28,8 +28,13 @@ test.describe.serial('JSON Response Formatting with BigInt', () => {
const responseBody = page.locator('.response-pane');
await expect(responseBody).toBeVisible();
// The response should echo back our request data
await expect(responseBody).toContainText('"data": 1736184243098437392');
// The response should preserve `bigint` value precision
await expect(responseBody).toContainText('1736184243098437392');
// The response should handle unicode chars
await expect(responseBody).toContainText('一');
await expect(responseBody).toContainText('二');
await expect(responseBody).toContainText('三');
});
});
});

View File

@@ -1,6 +0,0 @@
{
"maximized": false,
"lastOpenedCollections": [
"{{projectRoot}}/tests/response/json-with-bigint-response-formatting/fixtures/collection"
]
}