From c8016a4f5c42da8c3eb0164968abd1d9bc0fe6c1 Mon Sep 17 00:00:00 2001 From: Joshua Li Date: Tue, 30 May 2023 13:09:47 -0700 Subject: [PATCH] Use valid json for mock data in unit tests (#76) Signed-off-by: Joshua Li --- .gitignore | 1 + package.json | 1 + test/mocks/mockData.ts | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index d3fce840..7274d888 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ node_modules/ .cypress/screenshots .cypress/videos /target/* +/coverage/ diff --git a/package.json b/package.json index ce39f6fd..9c80ece2 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "test:server": "plugin-helpers test:server", "test:browser": "plugin-helpers test:browser", "test:jest": "../../node_modules/.bin/jest --config test/jest.config.js", + "test": "yarn test:jest", "build": "yarn plugin-helpers build", "plugin-helpers": "node ../../scripts/plugin_helpers" }, diff --git a/test/mocks/mockData.ts b/test/mocks/mockData.ts index 22b2eaba..1418720e 100644 --- a/test/mocks/mockData.ts +++ b/test/mocks/mockData.ts @@ -2331,6 +2331,6 @@ export const mockResultWithNull = { "data": { "ok": true, - "resp": "\"schema\":[{\"name\":\"name\",\"type\":\"keyword\"},{\"name\":\"city\",\"type\":\"keyword\"}],\"datarows\":[[\"Hattie\",\"Seattle\"],[\"John\"]]" + "resp": "{\"schema\":[{\"name\":\"name\",\"type\":\"keyword\"},{\"name\":\"city\",\"type\":\"keyword\"}],\"datarows\":[[\"Hattie\",\"Seattle\"],[\"John\"]]}" } }