From 0c50b82248c5827f93c1da9f998fc1f753cf60c7 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 7 Jun 2022 08:41:45 +0100 Subject: [PATCH] Account for types being undefined when running in a test env --- packages/server/src/integrations/postgres.ts | 9 ++++++--- packages/server/yarn.lock | 18 +++++++++--------- packages/worker/yarn.lock | 18 +++++++++--------- 3 files changed, 24 insertions(+), 21 deletions(-) diff --git a/packages/server/src/integrations/postgres.ts b/packages/server/src/integrations/postgres.ts index c7f02733a2..f0c5911476 100644 --- a/packages/server/src/integrations/postgres.ts +++ b/packages/server/src/integrations/postgres.ts @@ -22,9 +22,12 @@ module PostgresModule { // Return "date" and "timestamp" types as plain strings. // This lets us reference the original stored timezone. - types.setTypeParser(1114, (val: any) => val) // timestamp - types.setTypeParser(1082, (val: any) => val) // date - types.setTypeParser(1184, (val: any) => val) // timestampz + // types is undefined when running in a test env for some reason. + if (types) { + types.setTypeParser(1114, (val: any) => val) // timestamp + types.setTypeParser(1082, (val: any) => val) // date + types.setTypeParser(1184, (val: any) => val) // timestampz + } const JSON_REGEX = /'{.*}'::json/s diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index c8dad37383..e8e1d3e269 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1014,10 +1014,10 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.0.194": - version "1.0.194" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.194.tgz#08b2b1aec3c88efbc7cfb14145ce6f199475c538" - integrity sha512-BbnJFtAioJeD9tQfSwc2uftFK8SagREgSfUYv06dfnf/NsmkrONzZiTon1oA57S7ifcSiu+WZf87lNX0k8pwfQ== +"@budibase/backend-core@1.0.195": + version "1.0.195" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.195.tgz#ee40c690ae4a54febab8b140c9bbb7d04221f3b9" + integrity sha512-6diWgRV9t4DU3kXteJJAhCxyta9m1wvzN7vNbflhY4kYJeg7BC+7jcvc2r8zl6s1vVeSW4ic5/ueSLRaTDySuw== dependencies: "@techpass/passport-openidconnect" "^0.3.0" aws-sdk "^2.901.0" @@ -1092,12 +1092,12 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@1.0.194": - version "1.0.194" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.194.tgz#fbf977b292b9a6dbf7b072b2e0379dcf4379943a" - integrity sha512-LSqVwlhKWwFNnC3acvLnCzbeBoze1Ma6GELE/b5ZxS65owsigu0KC6T/UuujEbU9xqbFJ3R6uV+4Fz4NUibLIw== +"@budibase/pro@1.0.195": + version "1.0.195" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.195.tgz#368652398d1da95f160fc0192b77144b11147ff5" + integrity sha512-zf1f1exHop4m6vda5hObUnTZa2PIBRnc4e0r9iqFbzvGBMfBLGUhGzu23JEwNYaS2xhWHj2FNv4/IVzIyLG4eA== dependencies: - "@budibase/backend-core" "1.0.194" + "@budibase/backend-core" "1.0.195" node-fetch "^2.6.1" "@budibase/standard-components@^0.9.139": diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index a5f5b6b95a..2f3313a1d9 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -293,10 +293,10 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.0.194": - version "1.0.194" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.194.tgz#08b2b1aec3c88efbc7cfb14145ce6f199475c538" - integrity sha512-BbnJFtAioJeD9tQfSwc2uftFK8SagREgSfUYv06dfnf/NsmkrONzZiTon1oA57S7ifcSiu+WZf87lNX0k8pwfQ== +"@budibase/backend-core@1.0.195": + version "1.0.195" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.195.tgz#ee40c690ae4a54febab8b140c9bbb7d04221f3b9" + integrity sha512-6diWgRV9t4DU3kXteJJAhCxyta9m1wvzN7vNbflhY4kYJeg7BC+7jcvc2r8zl6s1vVeSW4ic5/ueSLRaTDySuw== dependencies: "@techpass/passport-openidconnect" "^0.3.0" aws-sdk "^2.901.0" @@ -322,12 +322,12 @@ uuid "^8.3.2" zlib "^1.0.5" -"@budibase/pro@1.0.194": - version "1.0.194" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.194.tgz#fbf977b292b9a6dbf7b072b2e0379dcf4379943a" - integrity sha512-LSqVwlhKWwFNnC3acvLnCzbeBoze1Ma6GELE/b5ZxS65owsigu0KC6T/UuujEbU9xqbFJ3R6uV+4Fz4NUibLIw== +"@budibase/pro@1.0.195": + version "1.0.195" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.195.tgz#368652398d1da95f160fc0192b77144b11147ff5" + integrity sha512-zf1f1exHop4m6vda5hObUnTZa2PIBRnc4e0r9iqFbzvGBMfBLGUhGzu23JEwNYaS2xhWHj2FNv4/IVzIyLG4eA== dependencies: - "@budibase/backend-core" "1.0.194" + "@budibase/backend-core" "1.0.195" node-fetch "^2.6.1" "@cspotcode/source-map-consumer@0.8.0":