LaTeX-Workshop/test
2022-12-29 14:16:05 +08:00
..
config Move files to test/config 2022-04-06 08:16:18 +09:00
fixtures Make up the switching intellisense test for multiroot 2022-12-29 10:58:40 +08:00
suites Do not need so many builds 2022-12-29 14:16:05 +08:00
utils Remove the interfaces 2022-12-13 11:24:25 +08:00
README.md Do not need so many builds 2022-12-29 14:16:05 +08:00
runTest.ts Tweak 'switching intellisense' test 2022-12-29 12:58:40 +08:00
viewer.index.ts enable esModuleInterop in tsconfig.json, which is necessary to compile with the jimp package. 2020-05-02 19:22:34 +09:00
viewer.test.ts Re-export sleep from test/utils/ciutils.ts 2022-05-13 08:47:04 +09:00

Overview

Executing tests

We start a new VS Code instance for testground, multiroot, and viewer directories in test/fixtures/, which includes a series of TeX-related files for tests, and execute appropriate tests defined in suites/*.test.ts (viewer.test.ts for viewer fixture) while skipping other tests not related to the directory. For tests of building a LaTeX file, we try to build a LaTeX file in the directory. If a PDF file is not generated, the test fails. The TeX files related are automatically created before the test and removed after.

How tests are executed via CLI

  1. runTest.ts starts a new VS Code instance for each fixture directory and executes suites/index.ts (viewer.test.ts for viewer fixture).
  2. Tests in *.test.ts are executed through runTest defined in suites/utils.ts, which skip tests in *.test.ts if they are not related to the current fixture directory.

How tests are executed via VS Code launch

We have a Run Tests launch configuration in .vscode/launch.json. In the config item, the first args passed to code defines the workspace to open: testground typically, and multiroot/resource.code-workspace for the multi-root workspace tests. Additionally, the LATEXWORKSHOP_SUITE envvar defines the suites to be executed, separated by commas and all if left empty.

Executing Tests on GitHub Actions

Read .github/workflows to see how tests are executed on GitHub Actions.