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

Add tests to insight parser #30

Open
11 tasks done
lizTheDeveloper opened this issue Feb 16, 2018 · 6 comments
Open
11 tasks done

Add tests to insight parser #30

lizTheDeveloper opened this issue Feb 16, 2018 · 6 comments
Assignees

Comments

@lizTheDeveloper
Copy link
Contributor

lizTheDeveloper commented Feb 16, 2018

Create tests for the Insight class in lib/insight.js

  • Test the parse method with several fixtures, at least 10 real insights from different areas.
  • Ensure the parse method can handle games
  • Check that the metadata is all captured, test every field present in the yaml from each of the fixtures.
  • Ensure that non-yaml properties like title are properly parsed
  • Ensure that practice questions are properly parsed
  • Ensure that revision questions are properly parsed
  • Ensure that quiz questions are properly parsed
  • Ensure that insights with images are properly parsed
  • Ensure that links properties are properly parsed as a list, with a type.
  • Ensure that the toJSON method can properly create or update an insight from our mongoose models
  • Ensure that the render method can reproduce what was parsed, even if there are unsupported yaml fields (but not unsupported sections, yet)
This was referenced Feb 17, 2018
@milesflo
Copy link

Working on this now 👍

@milesflo
Copy link

Moving Games parsing to a separate file called games.js

@milesflo
Copy link

@lizTheDeveloper Got 'em all

@milesflo
Copy link

@milesflo
Copy link

Render returns a properly formatted Insight, but sometimes it is different from the original insight in terms of whitespace...

@milesflo
Copy link

milesflo commented Mar 1, 2018

I've reworked the render test suite to work off of the AST parser.

Insight object will render, be parsed by the AST parser, and compare the values of the given property.

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

No branches or pull requests

2 participants