Clayton
09/09/2021, 9:13 PMtest(…)
function that doesn’t seem to be imported/created anywhere within the code.
I haven’t done much JS testing, so perhaps this is something basic I don’t know about yet.
What is providing this global test
function something - is via SST or something else?
ThanksAdrián Mouly
09/09/2021, 9:14 PMthdxr
09/09/2021, 9:14 PMClayton
09/09/2021, 9:21 PMtest
is a legit function with typing?
Is the SST project connecting these wires somehow? Seemed a bit magical since there are no explicit typescript files in the SST boilerplate.Ross Coundon
09/10/2021, 6:53 AMAdrián Mouly
09/10/2021, 6:57 AMAdrián Mouly
09/10/2021, 6:57 AMRoss Coundon
09/10/2021, 6:59 AMtestMatch: ['**/test/**/*.it.ts?(x)', '**/test/**/*.test.ts?(x)'],
to only include the folders you needAdrián Mouly
09/10/2021, 7:18 AMAdrián Mouly
09/10/2021, 7:18 AMAdrián Mouly
09/10/2021, 7:18 AMRoss Coundon
09/10/2021, 7:23 AMmodule.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
testPathIgnorePatterns: ['.d.ts', '.js'],
testMatch: ['**/test/**/*.it.ts?(x)', '**/test/**/*.test.ts?(x)'],
moduleNameMapper: {
'@/(.*)$': '<rootDir>/src/main/$1',
},
moduleFileExtensions: ["ts", "tsx", "js"],
collectCoverage: false,
collectCoverageFrom: ['src/main/**/*.{js,ts}'],
};
Adrián Mouly
09/10/2021, 7:32 AMAdrián Mouly
09/10/2021, 7:32 AMAdrián Mouly
09/10/2021, 7:32 AMRoss Coundon
09/10/2021, 7:55 AMarda
10/19/2021, 6:58 PMjest.config.js
override the default one provided by SST? I am having mine like:
module.exports = {
testEnvironment: 'node',
testMatch: ['**/__tests__/test_cases/**/*']
}
but it still matches unintended filesthdxr
10/19/2021, 6:59 PMthdxr
10/19/2021, 6:59 PMthdxr
10/19/2021, 6:59 PMtest: AWS_SDK_LOAD_CONFIG=1 jest
arda
10/19/2021, 7:00 PMthdxr
10/19/2021, 7:01 PMarda
10/19/2021, 7:02 PMarda
10/19/2021, 7:05 PMSyntaxError: Cannot use import statement outside a module
which requires some additional Babel config, while sst test
has it handled behind the scenethdxr
10/19/2021, 7:08 PMthdxr
10/19/2021, 7:08 PMthdxr
10/19/2021, 7:09 PMthdxr
10/19/2021, 7:09 PMesbuild-runner
thdxr
10/19/2021, 7:09 PMmodule.exports = {
roots: ["<rootDir>/test"],
testMatch: ["**/*.*test.(ts|tsx|js)"],
transform: {
"\\.ts$": "esbuild-runner/jest",
},
}
arda
10/19/2021, 7:13 PMthdxr
10/19/2021, 7:15 PM.ts
- maybe try including .js
as wellarda
10/19/2021, 8:03 PMthdxr
10/19/2021, 8:07 PM