diff --git a/src-test/test.js b/src-test/test.js index c1f12823..7baa2021 100644 --- a/src-test/test.js +++ b/src-test/test.js @@ -268,6 +268,14 @@ describe('mermaid-cli', () => { expectBytesAreFormat(await fs.readFile(expectedOutputFile), 'png') }, timeout) + test('the id of can be set', async () => { + const outputFile = 'test-positive/flowchart1.mmd.svg' + await fs.rm(outputFile, { force: true }) + await promisify(execFile)('node', ['src/cli.js', '-i', 'test-positive/flowchart1.mmd', '-o', outputFile, '-I', 'custom-id']) + + expect((await fs.readFile(outputFile)).toString()).toMatch(/^]+id="custom-id"/) + }, timeout) + test.concurrent.each(['svg', 'png', 'pdf'])('should set red background to %s', async (format) => { await promisify(execFile)('node', [ 'src/cli.js', '-i', 'test-positive/flowchart1.mmd', '-o', `test-output/flowchart1-red-background.${format}`,