mirror of
https://github.com/amitwh/markdown-converter.git
synced 2026-08-03 02:11:07 +05:30
- Normalize pandoc command parsing with path.basename() to support bundled binary paths - Use bundled pandoc binary in convertWithPandoc instead of relying on PATH - Forward includeSubfolders checkbox state from renderer to main process - Add pandoc availability check before batch conversion - Re-enable Start button when batch conversion completes - Clean up obsolete dist build artifact causing test snapshot warning - Bump version to 4.4.4
29 lines
874 B
JavaScript
29 lines
874 B
JavaScript
/**
|
|
* Tests for bundled external tools
|
|
*/
|
|
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
describe('Bundled Pandoc binary', () => {
|
|
const rootDir = path.resolve(__dirname, '..');
|
|
const platform = process.platform;
|
|
const binaryPath = path.join(rootDir, 'bin', platform, 'pandoc');
|
|
const windowsBinaryPath = path.join(rootDir, 'bin', platform, 'pandoc.exe');
|
|
|
|
test('Pandoc binary exists for current platform', () => {
|
|
const exists = fs.existsSync(binaryPath) || fs.existsSync(windowsBinaryPath);
|
|
expect(exists).toBe(true);
|
|
});
|
|
|
|
test('Pandoc binary is executable', () => {
|
|
if (platform === 'win32') {
|
|
expect(fs.existsSync(windowsBinaryPath)).toBe(true);
|
|
} else {
|
|
expect(fs.existsSync(binaryPath)).toBe(true);
|
|
const stats = fs.statSync(binaryPath);
|
|
expect(stats.mode & 0o111).toBeGreaterThan(0);
|
|
}
|
|
});
|
|
});
|