metalsmith / metalsmith/headings

Tests always pass

Open
#6 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
22
Forks
8
PR merge metrics
No merged PRs in 30d

Description

Please correct me if I'm wrong, but it seems the test cases provided will never fail.
This is because you're calling the `done()` callback with any errors, thus suppressing a possible failed test case.

For example, the following test passes:
```
it('should preserve order with multiple selectors', function(done){
Metalsmith('test/fixture')
.use(markdown())
.use(headings({ selectors: ['h1', 'h2']}))
.build(function(err, files){
if (err) return done(err);
expect(1).toEqual(2)
done();
});
});
```

I'd suggest just letting any error through.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the test cases that use the asynchronous build callback, including the example for preserving order with multiple selectors. Run the test suite and verify that an intentionally failing assertion is reported rather than hidden by the callback handling. Done means test failures propagate correctly while successful asynchronous tests still pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
testing
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.