The original xulsword library test file (xulswordTest.js) was renamed to libxulsword.test.js according to jest's naming convention. This new file was refactored to take full advantage of the jest testbench. Several additional changes were made to provide jest development support within the vscode environment. These include:
pulled jest configuration information from the project's package.json file to a separate jest.config.js file. This facilitates a jest vscode launch configuration.
created a vscode launch configuration named Jest for debugging jest-based tests.
created a dirs.ts mock file (found under a mocks directory, also per jest naming convention standards) for testing libxulsword separate from the projects React/Electron environment.
Successful testing requires a .crosswire directory in the developer's $HOME directory containing at a minimum the KJV, UZV bibles and Pilgrim's Progress. The first three tests check for a properly configured crosswire directory. If these fail virtually all subsequent tests will fail as well.
One test related issue: two of the libxulsword tests fail. Apparently the UZV translation book of Psalms contains 151 chapters but the version I have shows only 150. Have I loaded the correct module or was the original test incorrect?
The original xulsword library test file (xulswordTest.js) was renamed to libxulsword.test.js according to jest's naming convention. This new file was refactored to take full advantage of the jest testbench. Several additional changes were made to provide jest development support within the vscode environment. These include:
Successful testing requires a .crosswire directory in the developer's $HOME directory containing at a minimum the KJV, UZV bibles and Pilgrim's Progress. The first three tests check for a properly configured crosswire directory. If these fail virtually all subsequent tests will fail as well.
One test related issue: two of the libxulsword tests fail. Apparently the UZV translation book of Psalms contains 151 chapters but the version I have shows only 150. Have I loaded the correct module or was the original test incorrect?