From 78e13e051df00e5c74268daa17ec09d825bda46e Mon Sep 17 00:00:00 2001 From: Chad Ostrowski <221614+chadoh@users.noreply.github.com> Date: Wed, 15 May 2024 16:30:35 -0400 Subject: [PATCH] fix: make contract.Spec tests work in browser importing from `/lib` meant it wasn't actually working in the browser this fixes it, but also requires the karma config tweak to make it work as expected Big thanks to @Shaptic Co-authored-by: George --- config/karma.conf.js | 2 +- test/unit/spec/contract_spec.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/karma.conf.js b/config/karma.conf.js index bc54a9a87..48e2b3921 100644 --- a/config/karma.conf.js +++ b/config/karma.conf.js @@ -16,7 +16,7 @@ module.exports = function (config) { ], preprocessors: { - '../test/**/*.js': ['webpack'] + '../test/**/*.{js,ts}': ['webpack'] }, webpack: webpackConfig, diff --git a/test/unit/spec/contract_spec.ts b/test/unit/spec/contract_spec.ts index 5ea7de000..e2ffbe3be 100644 --- a/test/unit/spec/contract_spec.ts +++ b/test/unit/spec/contract_spec.ts @@ -1,4 +1,4 @@ -import { xdr, Address, contract, Keypair } from "../../../lib"; +import { xdr, Address, contract, Keypair } from "../../.."; import { JSONSchemaFaker } from "json-schema-faker"; import spec from "../spec.json";