unexpectedjs / unexpected-markdown

Unexpected flavored markdown
MIT License
2 stars 1 forks source link

Port to evaldown #54

Closed alexjeffburke closed 4 years ago

alexjeffburke commented 4 years ago

Rewrite unexpected-markdown to evaluate snippets via evaldown.

As evaldown evolved problems arose where this module was at odds with the semantics supported by the newer runtime. The root cause was that a duplicate runtime effectively existed in this module which could then get out of sync etc.

Opt to sidestep this situation going forward by directly evaluating snippets using evaldown and having this module responsible for asserting on the result of attempting to do so only.

alexjeffburke commented 4 years ago

The biggest changes here are to the convertMarkdownToMocha file (https://github.com/unexpectedjs/unexpected-markdown/pull/54/files#diff-a666ff3aa411491e84b64207c5c4e20a) with the rest being the removal of the old runtime.

alexjeffburke commented 4 years ago

LGTM. I guess we're getting close to being able to ditch unexpected-markdown?

Yeah, if we wanted to :) I will say that with the runtime no longer duplicated what's here should at least be far easier to maintain which is at least a plus in the short term.

I still really like the use-case supported by unexpected-markdown of easily determine whether there are any errors in the examples and be able to surface that information in a very consumable way on CI - but there may well be easier/better way of achieving that we should definitely look into.