Skip to content

Commit

Permalink
test: remove unnecessary verbose flag from test commands
Browse files Browse the repository at this point in the history
Removed the '-v' flag from the spawnSync calls in the test cases. This simplifies the command while retaining the necessary functionality for detecting obsolete elements and attributes.

Signed-off-by: Jens Oliver Meiert <[email protected]>
  • Loading branch information
j9t committed Aug 17, 2024
1 parent 7fc75dc commit 60a97cd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions bin/obsohtml.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,31 +27,31 @@ describe('ObsoHTML', () => {
});

test('Detect obsolete elements', () => {
const result = spawnSync('node', ['bin/obsohtml.js', '-f', tempDir, '-v'], { encoding: 'utf-8' });
const result = spawnSync('node', ['bin/obsohtml.js', '-f', tempDir], { encoding: 'utf-8' });
expect(result.stdout).toContain("Found obsolete element 'center'");
});

test('Detect obsolete attributes', () => {
const result = spawnSync('node', ['bin/obsohtml.js', '-f', tempDir, '-v'], { encoding: 'utf-8' });
const result = spawnSync('node', ['bin/obsohtml.js', '-f', tempDir], { encoding: 'utf-8' });
expect(result.stdout).toContain("Found obsolete attribute 'align'");
});

test('Detect obsolete elements and attributes using absolute path', () => {
const absolutePath = path.resolve(tempDir);
const result = spawnSync('node', ['bin/obsohtml.js', '-f', absolutePath, '-v'], { encoding: 'utf-8' });
const result = spawnSync('node', ['bin/obsohtml.js', '-f', absolutePath], { encoding: 'utf-8' });
expect(result.stdout).toContain("Found obsolete element 'center'");
expect(result.stdout).toContain("Found obsolete attribute 'align'");
});

test('Detect obsolete elements and attributes using relative path', () => {
const relativePath = path.relative(process.cwd(), tempDir);
const result = spawnSync('node', ['bin/obsohtml.js', '--folder', relativePath, '-v'], { encoding: 'utf-8' });
const result = spawnSync('node', ['bin/obsohtml.js', '--folder', relativePath], { encoding: 'utf-8' });
expect(result.stdout).toContain("Found obsolete element 'center'");
expect(result.stdout).toContain("Found obsolete attribute 'align'");
});

test('Detect obsolete minimized attributes', () => {
const result = spawnSync('node', ['bin/obsohtml.js', '-f', tempDir, '-v'], { encoding: 'utf-8' });
const result = spawnSync('node', ['bin/obsohtml.js', '-f', tempDir], { encoding: 'utf-8' });
expect(result.stdout).toContain("Found obsolete attribute 'noshade'");
});
});

0 comments on commit 60a97cd

Please sign in to comment.