Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON-to-HTML and HTML-to-JSON #234

Merged
merged 9 commits into from
Dec 19, 2018
Merged

JSON-to-HTML and HTML-to-JSON #234

merged 9 commits into from
Dec 19, 2018

Conversation

matatk
Copy link
Owner

@matatk matatk commented Dec 19, 2018

Adds support for converting from JSON to HTML and from HTML to JSON, to be used by the splash page/script so that a splash page can be created on which the Landmarks scripts can run.

In support of #165

* Make a directory structure that will be compatible with adding more fixture-and-expectation tests.
* Code the variable names in test-landmarks.js in line with fixture and expectation terminology.
* Streamline the structure of the expectations (no more "expected" key).
* Create JsonToHtml and run an initial test.
* Include the name of the thing being tested in all test scripts'
  fundamental "is it working?" tests.
The single test is still pretty simple, but covers both of the previous
ones, which were really just to get started.
* This is written as a Node module and will eventually be run-able as a
  CLI script.
* The current test only checks for elements and contained text; need to
  add attributes.
* Also rename variable in LandmarksFinder test to make more sense.
Three of the test runners are very similar; this harmonises the bits
that can be harmonised.

In future it would be nice to DRY these.
The code is very common between the script and the test runner, which
obviates the need to do a bit of refactoring. That will have the
advantage of removing the JSDOM dependency from the test-runner and code
consumers.
* Move the JSDOM dependency to the script.
* Add some error-handling to the script.
* Add help info to the script.
* Support specifying a container element ID, or not, in the script.
@matatk matatk merged commit a103b70 into master Dec 19, 2018
@matatk matatk deleted the develop-json-to-html branch January 4, 2019 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant