ts question, I have a file `test/setup.ts` with a ...
# help
m
ts question, I have a file
test/setup.ts
with a
beforeAll
function. When I run
npx sst build
i get this error
Copy code
ReferenceError: beforeAll is not defined
    at Object.<anonymous> (/Users/mike/source/trevco-commerce/test/setup.ts:21:1)
    at Module._compile (internal/modules/cjs/loader.js:1072:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
    at Module.load (internal/modules/cjs/loader.js:937:32)
    at Function.Module._load (internal/modules/cjs/loader.js:778:12)
    at Module.require (internal/modules/cjs/loader.js:961:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object.<anonymous> (/Users/mike/source/trevco-commerce/.build/run.js:86:17)
    at Module._compile (internal/modules/cjs/loader.js:1072:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
t
Do you have
@types/jest
installed?
m
I do
I think this error is misleading somehow. I just switched to a different branch in the app and it works.
t
When running
sst build
if your
test
folder is included in
tsconfig.json
it'll probably try to build it and fail
Is
beforeAll
valid in
setup.ts
?
Thought that had to go in test files
m
import it into the test files. It works 🤷
I tried to include and exclude the test in tsconfig
false alarm! all good. Auto imports from vscode pulled a module from the setup file. Thanks!