chore: partially fix studio unit tests...

This commit is contained in:
TzeYiing committed 2024-04-25 03:51:49 +08:00
1 parent f73b9dcd59
commit ef504ec6da
5 files changed
+10 -3

No files matched your search

@@ -82,7 +82,7 @@ export const validateFields = (fields: RowField[]) => {
return errors
}
const parseValue = (originalValue: any, format: string) => {
export const parseValue = (originalValue: any, format: string) => {
try {
if (
originalValue === null ||
+1 -1
View File
@@ -8,7 +8,7 @@ const createJestConfig = nextJest({
const config = {
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
moduleDirectories: ['<rootDir>', 'node_modules'],
setupFiles: ['jest-canvas-mock', './tests/setup/radix'],
setupFiles: ['jest-canvas-mock', './tests/setup/radix', './tests/setup/ssr'],
testEnvironment: 'jsdom',
testTimeout: 10000,
testRegex: '(.*\\.test.(js|jsx|ts|tsx)$)',
+1
View File
@@ -8,6 +8,7 @@
"build": "next build",
"start": "next start",
"lint": "next lint",
"test": "jest",
"deploy:staging": "VERCEL_ORG_ID=team_E6KJ1W561hMTjon1QSwOh0WO VERCEL_PROJECT_ID=QmcmhbiAtCMFTAHCuGgQscNbke4TzgWULECctNcKmxWCoT vercel --prod -A .vercel/staging.json",
"typecheck": "tsc --noEmit",
"storybook": "start-storybook -p 6006",
@@ -1,4 +1,4 @@
import { removeJSONTrailingComma } from '/apps/studio/lib/helpers.ts'
import { removeJSONTrailingComma } from 'lib/helpers.ts'
describe('removeJSONTrailingComma', () => {
it('should handle an empty object', () => {
+6
View File
@@ -0,0 +1,6 @@
// import util from 'util'
// const util = require('util')
// window.TestEncoder = new util.TextEncoder('utf-8');
import { TextEncoder, TextDecoder } from 'util';
Object.assign(global, { TextDecoder, TextEncoder });