The tests in TALY are based on Jest.
The Jest Runner extension makes it possible to directly execute the tests.
As an alternative, the following way can also be used:
A predefined configuration is available to debug tests in Visual Studio Code. Follow these steps:
Jest Current File of specific project
debugging target. Select the project where the test file resides, when promptedSometimes, it might be interesting to take a closer look at certain performance aspects of code in tests. v8-profiler-next can be used to do profiling of Jest Tests.
For that, a test can be modified like this:
import { setGenerateType, startProfiling, stopProfiling } from 'v8-profiler-next';
import { writeFileSync } from 'fs';
setGenerateType(1);
describe('A Test', () => {
startProfiling();
afterAll(() => {
const profile = stopProfiling();
profile.export(function (error, result: any) {
writeFileSync(`capture.cpuprofile`, result);
profile.delete();
});
});
}
At some point, in a not too distant past, the built in profiling of vscode could also be used for the tests. Unfortunately, this currently doesn't work, which is why the v8-profiler approach can be used.
Of course, it might be that it was fixed at some point between these words being written and them being read again.
If you want to check on that, follow these steps:
beforeAll
afterAll